Title: [201635] trunk
Revision
201635
Author
[email protected]
Date
2016-06-02 22:27:53 -0700 (Thu, 02 Jun 2016)

Log Message

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.

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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201634 => 201635)


--- trunk/LayoutTests/ChangeLog	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/LayoutTests/ChangeLog	2016-06-03 05:27:53 UTC (rev 201635)
@@ -1,3 +1,18 @@
+2016-06-02  Zalan Bujtas  <[email protected]>
+
+        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  <[email protected]>
 
         Fix a typo in the clz32() tests

Added: trunk/LayoutTests/fast/repaint/vertical-text-repaint-expected.txt (0 => 201635)


--- trunk/LayoutTests/fast/repaint/vertical-text-repaint-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/vertical-text-repaint-expected.txt	2016-06-03 05:27:53 UTC (rev 201635)
@@ -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

Added: trunk/LayoutTests/fast/repaint/vertical-text-repaint.html (0 => 201635)


--- trunk/LayoutTests/fast/repaint/vertical-text-repaint.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/vertical-text-repaint.html	2016-06-03 05:27:53 UTC (rev 201635)
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html>
+<script>jsTestIsAsync = true;</script>
+<script src=""
+<head>
+<title>This tests that we issue repaints on vertical content properly.</title>
+<style>
+div {
+  position: absolute;
+  font-family: ahem;
+  font-size: 10px;
+}
+
+.container {
+  top: 10px;
+  left: 10px;
+  width: 80px;
+  height: 80px;
+  background-color: green;
+  -webkit-writing-mode: vertical-rl;
+}
+</style>
+</head>
+<body>
+<div style="position: absolute; left: 0px; top: 0px;">
+  <div style="-webkit-writing-mode: vertical-lr; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="-webkit-writing-mode: horizontal-tb; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 0px; top: 130px;">
+  <div style="-webkit-writing-mode: vertical-lr; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 0px; top: 260px;">
+  <div style="width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 130px; top: 0px;">
+  <div style="-webkit-writing-mode: horizontal-tb; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="-webkit-writing-mode: horizontal-tb; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 130px; top: 130px;">
+  <div style="-webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="-webkit-writing-mode: vertical-rl; width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 130px; top: 130px;">
+  <div style="-webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<div style="position: absolute; left: 130px; top: 260px;">
+  <div style="position: relative; -webkit-writing-mode: vertical-rl; width: 120px; height: 120px; background-color: red; top: 5px; left: 5px;">
+    <div style="width: 100px; height: 100px; background-color: blue; top: 10px; left: 10px;">
+      <div class=container>foobar</div>
+    </div>
+  </div>
+</div>
+
+<script>
+setTimeout(function() {
+  if (window.internals)
+    internals.startTrackingRepaints();
+
+  var elements = document.getElementsByClassName("container");
+  for (var i = 0; i < elements.length; ++i)
+  	elements[i].innerText = "moobar";
+
+  document.body.offsetWidth;
+
+  if (window.internals) {
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 25')", "-1");
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 155')", "-1");
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('95 285')", "-1");
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 25')", "-1");
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 155')", "-1");
+    shouldNotBe("window.internals.repaintRectsAsText().indexOf('225 285')", "-1");
+    internals.stopTrackingRepaints();
+  }
+  finishJSTest();
+}, 0);
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (201634 => 201635)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-06-03 05:27:53 UTC (rev 201635)
@@ -221,3 +221,5 @@
 
 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 ]

Modified: trunk/Source/WebCore/ChangeLog (201634 => 201635)


--- trunk/Source/WebCore/ChangeLog	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/ChangeLog	2016-06-03 05:27:53 UTC (rev 201635)
@@ -1,3 +1,45 @@
+2016-06-02  Zalan Bujtas  <[email protected]>
+
+        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  <[email protected]>
 
         Fix build

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -2206,7 +2206,7 @@
 #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 @@
         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 @@
     // 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 @@
     // 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 @@
     // 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 @@
         }
     }
 
-    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)

Modified: trunk/Source/WebCore/rendering/RenderBox.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderBox.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -392,7 +392,7 @@
     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);
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -1260,7 +1260,7 @@
     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 @@
         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

Modified: trunk/Source/WebCore/rendering/RenderInline.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderInline.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderInline.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -145,7 +145,7 @@
 
     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;

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -964,7 +964,7 @@
     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 @@
         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

Modified: trunk/Source/WebCore/rendering/RenderObject.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderObject.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -742,11 +742,20 @@
     // 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; }

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -386,14 +386,14 @@
     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

Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderTableCell.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -153,7 +153,7 @@
     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;

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -691,7 +691,7 @@
     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 @@
             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).

Modified: trunk/Source/WebCore/rendering/RenderView.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/RenderView.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/RenderView.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -76,7 +76,7 @@
     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();

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -103,9 +103,9 @@
     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

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -41,7 +41,7 @@
 
     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;

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -382,7 +382,7 @@
         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.

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (201634 => 201635)


--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2016-06-03 05:27:53 UTC (rev 201635)
@@ -90,9 +90,9 @@
     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

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.h (201634 => 201635)


--- trunk/Source/WebCore/rendering/svg/RenderSVGText.h	2016-06-03 04:33:04 UTC (rev 201634)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.h	2016-06-03 05:27:53 UTC (rev 201635)
@@ -78,7 +78,7 @@
     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;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to