Title: [96154] trunk
Revision
96154
Author
m...@apple.com
Date
2011-09-27 14:04:04 -0700 (Tue, 27 Sep 2011)

Log Message

<rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer()

Reviewed by Simon Fraser.

Source/WebCore: 

Test: fast/dynamic/layer-no-longer-paginated.html

FrameView::layout() calls adjustViewSize() before calling RenderLayer::updateLayerPositions().
The former may trigger painting with a layer tree that is not entirely up-to-date. Specifically,
the isPaginated() state of a layer may be incorrect, leading to the assertion in this bug. Instead
of asserting, return early and count on the upcoming updateLayerPositions() to repaint as needed.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintPaginatedChildLayer): Replaced the assertion with an early return.

LayoutTests: 

* fast/dynamic/layer-no-longer-paginated-expected.txt: Added.
* fast/dynamic/layer-no-longer-paginated.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96153 => 96154)


--- trunk/LayoutTests/ChangeLog	2011-09-27 21:02:34 UTC (rev 96153)
+++ trunk/LayoutTests/ChangeLog	2011-09-27 21:04:04 UTC (rev 96154)
@@ -1,3 +1,12 @@
+2011-09-27  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer()
+
+        Reviewed by Simon Fraser.
+
+        * fast/dynamic/layer-no-longer-paginated-expected.txt: Added.
+        * fast/dynamic/layer-no-longer-paginated.html: Added.
+
 2011-09-27  Ojan Vafai  <o...@chromium.org>
 
         offsetTop/offsetLeft return the wrong values for horizontal-bt/vertical-rl writing modes

Added: trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt (0 => 96154)


--- trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt	2011-09-27 21:04:04 UTC (rev 96154)
@@ -0,0 +1,5 @@
+Test for <rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer().
+
+The test passes if it does not cause an assertion failure or a crash.
+
+

Added: trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated.html (0 => 96154)


--- trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dynamic/layer-no-longer-paginated.html	2011-09-27 21:04:04 UTC (rev 96154)
@@ -0,0 +1,32 @@
+<body style="overflow: hidden;">
+    <p>
+        Test for <i><a href=""
+        Assertion failure in <tt>RenderLayer::paintPaginatedChildLayer()</tt></i>.
+    </p>
+    <p>
+        The test passes if it does not cause an assertion failure or a crash.
+    </p>
+    <!-- specifying opacity < 1 so that the transition from having columns
+         to not having columns does not cause the layer to go away -->
+    <div id="target" style="-webkit-column-count: 2; opacity: 0.5; height: 20px;">
+        <div style="position:relative;"></div>
+    </div>
+    <div id="widener" style="height: 10px; width: 200%;"></div>
+    <script>
+        function test()
+        {
+            document.getElementById("widener").style.removeProperty("width");
+            document.getElementById("target").style.removeProperty("-webkit-column-count");
+        }
+ 
+               window.scrollBy(1, 0);
+
+        if (window.layoutTestController) {
+            layoutTestController.display();
+            layoutTestController.dumpAsText();
+            test();
+        } else
+            setTimeout(test, 500);
+
+    </script>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (96153 => 96154)


--- trunk/Source/WebCore/ChangeLog	2011-09-27 21:02:34 UTC (rev 96153)
+++ trunk/Source/WebCore/ChangeLog	2011-09-27 21:04:04 UTC (rev 96154)
@@ -1,3 +1,19 @@
+2011-09-27  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer()
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/dynamic/layer-no-longer-paginated.html
+
+        FrameView::layout() calls adjustViewSize() before calling RenderLayer::updateLayerPositions().
+        The former may trigger painting with a layer tree that is not entirely up-to-date. Specifically,
+        the isPaginated() state of a layer may be incorrect, leading to the assertion in this bug. Instead
+        of asserting, return early and count on the upcoming updateLayerPositions() to repaint as needed.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintPaginatedChildLayer): Replaced the assertion with an early return.
+
 2011-09-27  Ojan Vafai  <o...@chromium.org>
 
         offsetTop/offsetLeft return the wrong values for horizontal-bt/vertical-rl writing modes

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (96153 => 96154)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-09-27 21:02:34 UTC (rev 96153)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-09-27 21:04:04 UTC (rev 96154)
@@ -2859,8 +2859,12 @@
             break;
     }
 
-    ASSERT(columnLayers.size());
-    
+    // It is possible for paintLayer() to be called after the child layer ceases to be paginated but before
+    // updateLayerPositions() is called and resets the isPaginated() flag, see <rdar://problem/10098679>.
+    // If this is the case, just bail out, since the upcoming call to updateLayerPositions() will repaint the layer.
+    if (!columnLayers.size())
+        return;
+
     paintChildLayerIntoColumns(childLayer, rootLayer, context, paintDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags, columnLayers, columnLayers.size() - 1);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to