Repaint issue with vertical text in an out of flow container.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2016 05:27:53 +0000 (05:27 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2016 05:27:53 +0000 (05:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102665
<rdar://problem/26605298>

Reviewed by David Hyatt.

Since the renderer’s offset for positioned objects is always physical, we only
need to flip the repaint rect(always logical) for writing root, when we see the first positioned object.
All subsequent writing root changes for positioned objects are okay and they don't need flipping.

Source/WebCore:

Test: fast/repaint/vertical-text-repaint.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
* rendering/RenderBox.h:
(WebCore::RenderBox::computeRectForRepaint):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeRectForRepaint):
* rendering/RenderInline.h:
(WebCore::RenderInline::computeRectForRepaint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeRectForRepaint):
* rendering/RenderObject.h:
(WebCore::RenderObject::computeAbsoluteRepaintRect):
(WebCore::RenderObject::computeRectForRepaint):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeRectForRepaint):
* rendering/RenderTableCell.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeRectForRepaint):
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeRectForRepaint):
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatRectForRepaint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::computeRectForRepaint):
* rendering/svg/RenderSVGText.h:

LayoutTests:

* fast/repaint/vertical-text-repaint-expected.txt: Added.
* fast/repaint/vertical-text-repaint.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/vertical-text-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/vertical-text-repaint.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.h
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h

index b15e030..82dbdbd 100644 (file)
@@ -1,3 +1,18 @@
+2016-06-02  Zalan Bujtas  <zalan@apple.com>
+
+        Repaint issue with vertical text in an out of flow container.
+        https://bugs.webkit.org/show_bug.cgi?id=102665
+        <rdar://problem/26605298>
+
+        Reviewed by David Hyatt.
+
+        Since the renderer’s offset for positioned objects is always physical, we only
+        need to flip the repaint rect(always logical) for writing root, when we see the first positioned object.
+        All subsequent writing root changes for positioned objects are okay and they don't need flipping.
+
+        * fast/repaint/vertical-text-repaint-expected.txt: Added.
+        * fast/repaint/vertical-text-repaint.html: Added.
+
 2016-06-02  Benjamin Poulain  <bpoulain@apple.com>
 
         Fix a typo in the clz32() tests
diff --git a/LayoutTests/fast/repaint/vertical-text-repaint-expected.txt b/LayoutTests/fast/repaint/vertical-text-repaint-expected.txt
new file mode 100644 (file)
index 0000000..30b790c
--- /dev/null
@@ -0,0 +1,11 @@
+PASS window.internals.repaintRectsAsText().indexOf('95 25') is not -1
+PASS window.internals.repaintRectsAsText().indexOf('95 155') is not -1
+PASS window.internals.repaintRectsAsText().indexOf('95 285') is not -1
+PASS window.internals.repaintRectsAsText().indexOf('225 25') is not -1
+PASS window.internals.repaintRectsAsText().indexOf('225 155') is not -1
+PASS window.internals.repaintRectsAsText().indexOf('225 285') is not -1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+moobarmoobarmoobarmoobarmoobarmoobar
+moobar
diff --git a/LayoutTests/fast/repaint/vertical-text-repaint.html b/LayoutTests/fast/repaint/vertical-text-repaint.html
new file mode 100644 (file)
index 0000000..08bb407
--- /dev/null
@@ -0,0 +1,106 @@
+<!DOCTYPE html>\r
+<html>\r
+<script>jsTestIsAsync = true;</script>\r
+<script src="../../resources/js-test-pre.js"></script>\r
+<head>\r
+<title>This tests that we issue repaints on vertical content properly.</title>\r
+<style>\r
+div {\r
+  position: absolute;\r
+  font-family: ahem;\r
+  font-size: 10px;\r
+}\r
+\r
+.container {\r
+  top: 10px;\r
+  left: 10px;\r
+  width: 80px;\r
+  height: 80px;\r
+  background-color: green;\r
+  -webkit-writing-mode: vertical-rl;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+<div style="position: absolute; left: 0px; top: 0px;">\r
+  <div style="-webkit-writing-mode: vertical-lr; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="-webkit-writing-mode: horizontal-tb; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 0px; top: 130px;">\r
+  <div style="-webkit-writing-mode: vertical-lr; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 0px; top: 260px;">\r
+  <div style="width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 130px; top: 0px;">\r
+  <div style="-webkit-writing-mode: horizontal-tb; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="-webkit-writing-mode: horizontal-tb; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 130px; top: 130px;">\r
+  <div style="-webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="-webkit-writing-mode: vertical-rl; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 130px; top: 130px;">\r
+  <div style="-webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<div style="position: absolute; left: 130px; top: 260px;">\r
+  <div style="position: relative; -webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">\r
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">\r
+      <div class=container>foobar</div>\r
+    </div>\r
+  </div>\r
+</div>\r
+\r
+<script>\r
+setTimeout(function() {\r
+  if (window.internals)\r
+    internals.startTrackingRepaints();\r
+\r
+  var elements = document.getElementsByClassName("container");\r
+  for (var i = 0; i < elements.length; ++i)\r
+       elements[i].innerText = "moobar";\r
+\r
+  document.body.offsetWidth;\r
+\r
+  if (window.internals) {\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 25')", "-1");\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 155')", "-1");\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 285')", "-1");\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 25')", "-1");\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 155')", "-1");\r
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 285')", "-1");\r
+    internals.stopTrackingRepaints();\r
+  }\r
+  finishJSTest();\r
+}, 0);\r
+</script>\r
+<script src="../../resources/js-test-post.js"></script>\r
+</body>\r
+</html>\r
index 37ba2b6..e64b5fb 100644 (file)
@@ -221,3 +221,5 @@ fast/loader/iframe-src-invalid-url.html [ Skip ]
 
 webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]
 
+# repaint rects work differently on WK1
+fast/repaint/vertical-text-repaint.html [ Pass Failure ]
index 708b679..1ac6a1e 100644 (file)
@@ -1,3 +1,45 @@
+2016-06-02  Zalan Bujtas  <zalan@apple.com>
+
+        Repaint issue with vertical text in an out of flow container.
+        https://bugs.webkit.org/show_bug.cgi?id=102665
+        <rdar://problem/26605298>
+
+        Reviewed by David Hyatt.
+
+        Since the renderer’s offset for positioned objects is always physical, we only
+        need to flip the repaint rect(always logical) for writing root, when we see the first positioned object.
+        All subsequent writing root changes for positioned objects are okay and they don't need flipping.
+
+        Test: fast/repaint/vertical-text-repaint.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeRectForRepaint):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::computeRectForRepaint):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::computeRectForRepaint):
+        * rendering/RenderInline.h:
+        (WebCore::RenderInline::computeRectForRepaint):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::computeRectForRepaint):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::computeAbsoluteRepaintRect):
+        (WebCore::RenderObject::computeRectForRepaint):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::computeRectForRepaint):
+        * rendering/RenderTableCell.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::computeRectForRepaint):
+        * rendering/RenderView.h:
+        * rendering/svg/RenderSVGForeignObject.cpp:
+        (WebCore::RenderSVGForeignObject::computeRectForRepaint):
+        * rendering/svg/RenderSVGForeignObject.h:
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::computeFloatRectForRepaint):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::computeRectForRepaint):
+        * rendering/svg/RenderSVGText.h:
+
 2016-06-02  Anders Carlsson  <andersca@apple.com>
 
         Fix build
index 9e1a5a2..9c37d1b 100644 (file)
@@ -2206,7 +2206,7 @@ static inline bool shouldApplyContainersClipAndOffset(const RenderLayerModelObje
 #endif
 }
 
-LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
     // The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space.
     // Only when we cross a writing mode boundary will we have to possibly flipForWritingMode (to convert into a more appropriate
@@ -2245,13 +2245,11 @@ LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const Render
         return adjustedRect;
     }
 
-    bool containerSkipped;
-    auto* renderer = container(repaintContainer, containerSkipped);
-    if (!renderer)
+    bool repaintContainerIsSkipped;
+    auto* container = this->container(repaintContainer, repaintContainerIsSkipped);
+    if (!container)
         return adjustedRect;
     
-    EPosition position = styleToUse.position();
-
     // This code isn't necessary for in-flow RenderFlowThreads.
     // Don't add the location of the region in the flow thread for absolute positioned
     // elements because their absolute position already pushes them down through
@@ -2259,15 +2257,20 @@ LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const Render
     // us to add the height twice.
     // The same logic applies for elements flowed directly into the flow thread. Their topLeft member
     // will already contain the portion rect of the region.
-    if (renderer->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) {
+    EPosition position = styleToUse.position();
+    if (container->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) {
         RenderRegion* firstRegion = nullptr;
         RenderRegion* lastRegion = nullptr;
-        if (downcast<RenderFlowThread>(*renderer).getRegionRangeForBox(this, firstRegion, lastRegion))
+        if (downcast<RenderFlowThread>(*container).getRegionRangeForBox(this, firstRegion, lastRegion))
             adjustedRect.moveBy(firstRegion->flowThreadPortionRect().location());
     }
 
-    if (isWritingModeRoot() && !isOutOfFlowPositioned())
-        flipForWritingMode(adjustedRect);
+    if (isWritingModeRoot()) {
+        if (!isOutOfFlowPositioned() || !context.m_dirtyRectIsFlipped) {
+            flipForWritingMode(adjustedRect);
+            context.m_dirtyRectIsFlipped = true;
+        }
+    }
 
     LayoutSize locationOffset = this->locationOffset();
     // FIXME: This is needed as long as RenderWidget snaps to integral size/position.
@@ -2282,15 +2285,15 @@ LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const Render
     // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box
     // in the parent's coordinate space that encloses us.
     if (hasLayer() && layer()->transform()) {
-        fixed = position == FixedPosition;
+        context.m_hasPositionFixedDescendant = position == FixedPosition;
         adjustedRect = LayoutRect(encloseRectToDevicePixels(layer()->transform()->mapRect(adjustedRect), document().deviceScaleFactor()));
         topLeft = adjustedRect.location();
         topLeft.move(locationOffset);
     } else if (position == FixedPosition)
-        fixed = true;
+        context.m_hasPositionFixedDescendant = true;
 
-    if (position == AbsolutePosition && renderer->isInFlowPositioned() && is<RenderInline>(*renderer))
-        topLeft += downcast<RenderInline>(*renderer).offsetForInFlowPositionedInline(this);
+    if (position == AbsolutePosition && container->isInFlowPositioned() && is<RenderInline>(*container))
+        topLeft += downcast<RenderInline>(*container).offsetForInFlowPositionedInline(this);
     else if (styleToUse.hasInFlowPosition() && layer()) {
         // Apply the relative position offset when invalidating a rectangle.  The layer
         // is translated, but the render box isn't, so we need to do this to get the
@@ -2302,8 +2305,8 @@ LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const Render
     // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout,
     // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer.
     adjustedRect.setLocation(topLeft);
-    if (renderer->hasOverflowClip()) {
-        RenderBox& containerBox = downcast<RenderBox>(*renderer);
+    if (container->hasOverflowClip()) {
+        RenderBox& containerBox = downcast<RenderBox>(*container);
         if (shouldApplyContainersClipAndOffset(repaintContainer, &containerBox)) {
             containerBox.applyCachedClipAndScrollOffsetForRepaint(adjustedRect);
             if (adjustedRect.isEmpty())
@@ -2311,13 +2314,13 @@ LayoutRect RenderBox::computeRectForRepaint(const LayoutRect& rect, const Render
         }
     }
 
-    if (containerSkipped) {
-        // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
-        LayoutSize containerOffset = repaintContainer->offsetFromAncestorContainer(*renderer);
+    if (repaintContainerIsSkipped) {
+        // If the repaintContainer is below container, then we need to map the rect into repaintContainer's coordinates.
+        LayoutSize containerOffset = repaintContainer->offsetFromAncestorContainer(*container);
         adjustedRect.move(-containerOffset);
         return adjustedRect;
     }
-    return renderer->computeRectForRepaint(adjustedRect, repaintContainer, fixed);
+    return container->computeRectForRepaint(adjustedRect, repaintContainer, context);
 }
 
 void RenderBox::repaintDuringLayoutIfMoved(const LayoutRect& oldRect)
index 163ed2a..c16e75c 100644 (file)
@@ -392,7 +392,7 @@ public:
     void deleteLineBoxWrapper();
 
     LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext context = { false, false }) const override;
     void repaintDuringLayoutIfMoved(const LayoutRect&);
     virtual void repaintOverhangingFloats(bool paintAllDescendants);
 
index d2fcbe4..87b694c 100644 (file)
@@ -1260,7 +1260,7 @@ LayoutRect RenderInline::rectWithOutlineForRepaint(const RenderLayerModelObject*
     return r;
 }
 
-LayoutRect RenderInline::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderInline::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
     // LayoutState is only valid for root-relative repainting
     LayoutRect adjustedRect = rect;
@@ -1307,7 +1307,7 @@ LayoutRect RenderInline::computeRectForRepaint(const LayoutRect& rect, const Ren
         adjustedRect.move(-containerOffset);
         return adjustedRect;
     }
-    return container->computeRectForRepaint(adjustedRect, repaintContainer, fixed);
+    return container->computeRectForRepaint(adjustedRect, repaintContainer, context);
 }
 
 LayoutSize RenderInline::offsetFromContainer(RenderElement& container, const LayoutPoint&, bool* offsetDependsOnPoint) const
index f268e97..d915660 100644 (file)
@@ -145,7 +145,7 @@ private:
 
     LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
     LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const final;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed) const final;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const final;
 
     void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
     const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
index 331e8c8..cbd2e64 100644 (file)
@@ -964,7 +964,7 @@ LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObj
     return LayoutRect();
 }
 
-LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
     if (repaintContainer == this)
         return rect;
@@ -979,7 +979,7 @@ LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const Ren
         if (adjustedRect.isEmpty())
             return adjustedRect;
     }
-    return parent->computeRectForRepaint(adjustedRect, repaintContainer, fixed);
+    return parent->computeRectForRepaint(adjustedRect, repaintContainer, context);
 }
 
 FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject*, bool) const
index c9641be..6486686 100644 (file)
@@ -742,11 +742,20 @@ public:
     // that rect in view coordinates.
     LayoutRect computeAbsoluteRepaintRect(const LayoutRect& r, bool fixed = false) const
     {
-        return computeRectForRepaint(r, nullptr, fixed);
+        return computeRectForRepaint(r, nullptr, { fixed, false });
     }
     // Given a rect in the object's coordinate space, compute a rect suitable for repainting
     // that rect in the coordinate space of repaintContainer.
-    virtual LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const;
+    struct RepaintContext {
+        RepaintContext(bool hasPositionFixedDescendant, bool dirtyRectIsFlipped)
+            : m_hasPositionFixedDescendant(hasPositionFixedDescendant)
+            , m_dirtyRectIsFlipped(dirtyRectIsFlipped)
+            {
+            }
+        bool m_hasPositionFixedDescendant { false };
+        bool m_dirtyRectIsFlipped { false };
+    };
+    virtual LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const;
     virtual FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const;
 
     virtual unsigned int length() const { return 1; }
index 1d7906d..5a99cd3 100644 (file)
@@ -386,14 +386,14 @@ LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel
     return computeRectForRepaint(r, repaintContainer);
 }
 
-LayoutRect RenderTableCell::computeRectForRepaint(const LayoutRect& r, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderTableCell::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
     if (repaintContainer == this)
-        return r;
-    LayoutRect adjustedRect = r;
+        return rect;
+    LayoutRect adjustedRect = rect;
     if ((!view().layoutStateEnabled() || repaintContainer) && parent())
         adjustedRect.moveBy(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in.
-    return RenderBlockFlow::computeRectForRepaint(adjustedRect, repaintContainer, fixed);
+    return RenderBlockFlow::computeRectForRepaint(adjustedRect, repaintContainer, context);
 }
 
 LayoutUnit RenderTableCell::cellBaselinePosition() const
index d0b3b4f..064b980 100644 (file)
@@ -153,7 +153,7 @@ private:
     bool boxShadowShouldBeAppliedToBackground(const LayoutPoint& paintOffset, BackgroundBleedAvoidance, InlineFlowBox*) const override;
 
     LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const override;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const override;
 
     LayoutUnit borderHalfLeft(bool outer) const;
     LayoutUnit borderHalfRight(bool outer) const;
index e1ea33e..f39af78 100644 (file)
@@ -691,7 +691,7 @@ LayoutRect RenderView::visualOverflowRect() const
     return RenderBlockFlow::visualOverflowRect();
 }
 
-LayoutRect RenderView::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderView::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
     // If a container was specified, and was not nullptr or the RenderView,
     // then we should have found it by now.
@@ -710,7 +710,7 @@ LayoutRect RenderView::computeRectForRepaint(const LayoutRect& rect, const Rende
             adjustedRect.setX(viewWidth() - adjustedRect.maxX());
     }
 
-    if (fixed)
+    if (context.m_hasPositionFixedDescendant)
         adjustedRect.moveBy(frameView().scrollPositionRespectingCustomFixedPosition());
     
     // Apply our transform if we have one (because of full page zooming).
index 4dad8fc..531e0c5 100644 (file)
@@ -76,7 +76,7 @@ public:
     FrameView& frameView() const { return m_frameView; }
 
     LayoutRect visualOverflowRect() const override;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const override;
     void repaintRootContents();
     void repaintViewRectangle(const LayoutRect&) const;
     void repaintViewAndCompositedLayers();
index c34928c..2bf086f 100644 (file)
@@ -103,9 +103,9 @@ FloatRect RenderSVGForeignObject::computeFloatRectForRepaint(const FloatRect& re
     return SVGRenderSupport::computeFloatRectForRepaint(*this, repaintRect, repaintContainer, fixed);
 }
 
-LayoutRect RenderSVGForeignObject::computeRectForRepaint(const LayoutRect& repaintRect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderSVGForeignObject::computeRectForRepaint(const LayoutRect& repaintRect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
-    return enclosingLayoutRect(computeFloatRectForRepaint(repaintRect, repaintContainer, fixed));
+    return enclosingLayoutRect(computeFloatRectForRepaint(repaintRect, repaintContainer, context.m_hasPositionFixedDescendant));
 }
 
 const AffineTransform& RenderSVGForeignObject::localToParentTransform() const
index 7bb1b10..de2de12 100644 (file)
@@ -41,7 +41,7 @@ public:
 
     LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
     FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const override;
 
     bool requiresLayer() const override { return false; }
     void layout() override;
index 62f89f8..d92b0e5 100644 (file)
@@ -382,7 +382,7 @@ FloatRect RenderSVGRoot::computeFloatRectForRepaint(const FloatRect& repaintRect
         LayoutRect decoratedRepaintRect = unionRect(localSelectionRect(false), visualOverflowRect());
         adjustedRect.unite(decoratedRepaintRect);
     }
-    return RenderReplaced::computeRectForRepaint(enclosingIntRect(adjustedRect), repaintContainer, fixed);
+    return RenderReplaced::computeRectForRepaint(enclosingIntRect(adjustedRect), repaintContainer, {fixed, false});
 }
 
 // This method expects local CSS box coordinates.
index 6f50b41..637c0c0 100644 (file)
@@ -90,9 +90,9 @@ LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelOb
     return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
 }
 
-LayoutRect RenderSVGText::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, bool fixed) const
+LayoutRect RenderSVGText::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, RepaintContext context) const
 {
-    return enclosingLayoutRect(computeFloatRectForRepaint(rect, repaintContainer, fixed));
+    return enclosingLayoutRect(computeFloatRectForRepaint(rect, repaintContainer, context.m_hasPositionFixedDescendant));
 }
 
 FloatRect RenderSVGText::computeFloatRectForRepaint(const FloatRect& repaintRect, const RenderLayerModelObject* repaintContainer, bool fixed) const
index d1e860f..7892ce8 100644 (file)
@@ -78,7 +78,7 @@ private:
     void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
 
     LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
-    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
+    LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { false, false }) const override;
     FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
 
     void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;