Title: [206343] trunk
Revision
206343
Author
[email protected]
Date
2016-09-23 17:45:48 -0700 (Fri, 23 Sep 2016)

Log Message

ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
https://bugs.webkit.org/show_bug.cgi?id=162466

Reviewed by Simon Fraser.

Source/WebCore:

When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
its containing block (calling RenderBlock::insertPositionedObject).
It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
We do it even when the containing block - positioned renderer pair is already in this tracker map.
RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
assuming it needs to layout this descendant later in the layout phase.
This patch ensure that we only flag the containing block dirty when the descendant needs layout.

Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::insertPositionedObject):

LayoutTests:

* fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt: Added.
* fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206342 => 206343)


--- trunk/LayoutTests/ChangeLog	2016-09-24 00:26:28 UTC (rev 206342)
+++ trunk/LayoutTests/ChangeLog	2016-09-24 00:45:48 UTC (rev 206343)
@@ -1,3 +1,13 @@
+2016-09-23  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
+        https://bugs.webkit.org/show_bug.cgi?id=162466
+
+        Reviewed by Simon Fraser.
+
+        * fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt: Added.
+        * fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html: Added.
+
 2016-09-23  Ryan Haddad  <[email protected]>
 
         Remove debug flag for flaky test js/regress-139548.html.

Added: trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt (0 => 206343)


--- trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt	2016-09-24 00:45:48 UTC (rev 206343)
@@ -0,0 +1 @@
+PASS if no assert in debug.

Added: trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html (0 => 206343)


--- trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html	2016-09-24 00:45:48 UTC (rev 206343)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that subtree layout works fine with positioned elements.</title>
+<style>
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+  
+.positionedParent {
+    position: absolute;
+}
+  
+.boundaryParent {
+    overflow: hidden;
+}
+  
+.positionedChild {
+    background-color: blue;
+    position: absolute;
+}
+  
+</style>
+</head>
+<body>
+<div>
+  <div class=positionedParent>
+    <div class=boundaryParent>
+	  <div id=sibling></div>
+	  <div class=positionedChild>PASS if no assert in debug.</div>
+    </div>
+  </div>
+</div>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+setTimeout(function() {
+    document.getElementById("sibling").style.width = "10px";
+    setTimeout(function() {
+        document.getElementById("sibling").style.width = "20px";
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }, 0);
+}, 0);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (206342 => 206343)


--- trunk/Source/WebCore/ChangeLog	2016-09-24 00:26:28 UTC (rev 206342)
+++ trunk/Source/WebCore/ChangeLog	2016-09-24 00:45:48 UTC (rev 206343)
@@ -1,3 +1,23 @@
+2016-09-23  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
+        https://bugs.webkit.org/show_bug.cgi?id=162466
+
+        Reviewed by Simon Fraser.
+
+        When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
+        its containing block (calling RenderBlock::insertPositionedObject).
+        It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
+        We do it even when the containing block - positioned renderer pair is already in this tracker map.
+        RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
+        assuming it needs to layout this descendant later in the layout phase.
+        This patch ensure that we only flag the containing block dirty when the descendant needs layout.
+
+        Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::insertPositionedObject):
+
 2016-09-23  Yusuke Suzuki  <[email protected]>
 
         [Binding] Use unchekcedArgument if argumentCount is already checked

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (206342 => 206343)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-09-24 00:26:28 UTC (rev 206342)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-09-24 00:45:48 UTC (rev 206343)
@@ -2250,12 +2250,14 @@
 void RenderBlock::insertPositionedObject(RenderBox& positioned)
 {
     ASSERT(!isAnonymousBlock());
-
     if (positioned.isRenderFlowThread())
         return;
-    // We should turn this bit on only while in layout.
-    ASSERT(posChildNeedsLayout() || view().frameView().isInLayout());
-    setPosChildNeedsLayoutBit(true);
+    // FIXME: Find out if we can do this as part of positioned.setChildNeedsLayout(MarkOnlyThis)
+    if (positioned.needsLayout()) {
+        // We should turn this bit on only while in layout.
+        ASSERT(posChildNeedsLayout() || view().frameView().isInLayout());
+        setPosChildNeedsLayoutBit(true);
+    }
     positionedDescendantsMap().addDescendant(*this, positioned, isRenderView() ? PositionedDescendantsMap::MoveDescendantToEnd::Yes
         : PositionedDescendantsMap::MoveDescendantToEnd::No);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to