Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2590)

Unified Diff: Source/WebCore/rendering/RenderObject.cpp

Issue 357810044: More wip
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | Source/WebCore/rendering/RenderTableCell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderObject.cpp
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 7e1b7615a3dafcb309ff5548b13176d5dfe09510..08ba653cad74369cfe966b52b4ec92794e96ca10 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -962,9 +962,33 @@ LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObj
return LayoutRect();
}
-LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
+bool RenderObject::shouldApplyCompositedContainerScrollsForRepaint()
{
- if (repaintContainer == this)
+#if PLATFORM(IOS)
+ return false;
+#else
+ return true;
+#endif
+}
+
+RenderObject::VisibleRectContext RenderObject::visibleRectContextForRepaint()
+{
+ return { false, false, false, false, shouldApplyCompositedContainerScrollsForRepaint() };
+}
+
+LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer) const
+{
+ return *computeVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint());
+}
+
+FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const RenderLayerModelObject* repaintContainer) const
+{
+ return *computeFloatVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint());
+}
+
+std::optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
+{
+ if (container == this)
return rect;
auto* parent = this->parent();
@@ -973,14 +997,17 @@ LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const Ren
LayoutRect adjustedRect = rect;
if (parent->hasOverflowClip()) {
- downcast<RenderBox>(*parent).applyCachedClipAndScrollPositionForRepaint(adjustedRect);
- if (adjustedRect.isEmpty())
+ bool isEmpty = downcast<RenderBox>(*parent).applyCachedClipAndScrollPosition(adjustedRect, container, context.m_applyCompositedClips, context.m_applyCompositedContainerScrolls, context.m_useEdgeInclusiveIntersection);
+ if (isEmpty) {
+ if (context.m_useEdgeInclusiveIntersection)
+ return std::nullopt;
return adjustedRect;
+ }
}
- return parent->computeRectForRepaint(adjustedRect, repaintContainer, context);
+ return parent->computeVisibleRectInContainer(adjustedRect, container, context);
}
-FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject*, bool) const
+std::optional<FloatRect> RenderObject::computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject*, VisibleRectContext) const
{
ASSERT_NOT_REACHED();
return FloatRect();
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | Source/WebCore/rendering/RenderTableCell.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b