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(); |