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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96154
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-27 Dan Bernstein <mitz@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 <ojan@chromium.org>
offsetTop/offsetLeft return the wrong values for horizontal-bt/vertical-rl writing modes
--- /dev/null
+Test for <rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer().
+
+The test passes if it does not cause an assertion failure or a crash.
+
+
--- /dev/null
+<body style="overflow: hidden;">
+ <p>
+ Test for <i><a href="rdar://problem/10098679"><rdar://problem/10098679></a>
+ 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>
+2011-09-27 Dan Bernstein <mitz@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 <ojan@chromium.org>
offsetTop/offsetLeft return the wrong values for horizontal-bt/vertical-rl writing modes
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);
}