Title: [209158] trunk
Revision
209158
Author
[email protected]
Date
2016-11-30 15:12:45 -0800 (Wed, 30 Nov 2016)

Log Message

ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
https://bugs.webkit.org/show_bug.cgi?id=155364
<rdar://problem/27720461>

Reviewed by David Hyatt.

Source/WebCore:

RenderNamedFlowThread is considered to be a root for the current renderer context so
we need to bail out from the containing block traversal here (like we do for the RenderView).

Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):

LayoutTests:

* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
* fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209157 => 209158)


--- trunk/LayoutTests/ChangeLog	2016-11-30 22:59:28 UTC (rev 209157)
+++ trunk/LayoutTests/ChangeLog	2016-11-30 23:12:45 UTC (rev 209158)
@@ -1,3 +1,14 @@
+2016-11-30  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
+        https://bugs.webkit.org/show_bug.cgi?id=155364
+        <rdar://problem/27720461>
+
+        Reviewed by David Hyatt.
+
+        * fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
+        * fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.
+
 2016-11-30  Jiewen Tan  <[email protected]>
 
         Update SubtleCrypto::wrapKey to match the latest spec

Added: trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt (0 => 209158)


--- trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt	2016-11-30 23:12:45 UTC (rev 209158)
@@ -0,0 +1 @@
+PASS if no assert in debug.

Added: trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html (0 => 209158)


--- trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html	                        (rev 0)
+++ trunk/LayoutTests/fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html	2016-11-30 23:12:45 UTC (rev 209158)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title></title>
+<style>
+canvas {
+    width: 100%;
+    position: fixed;
+    -webkit-flow-into: foobar;
+    -webkit-writing-mode: vertical-lr;
+}
+</style>
+</head>
+<body>
+<canvas></canvas>
+PASS if no assert in debug.
+<script>
+if (window.testRunner)
+  testRunner.dumpAsText();
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (209157 => 209158)


--- trunk/Source/WebCore/ChangeLog	2016-11-30 22:59:28 UTC (rev 209157)
+++ trunk/Source/WebCore/ChangeLog	2016-11-30 23:12:45 UTC (rev 209158)
@@ -1,3 +1,19 @@
+2016-11-30  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
+        https://bugs.webkit.org/show_bug.cgi?id=155364
+        <rdar://problem/27720461>
+
+        Reviewed by David Hyatt.
+
+        RenderNamedFlowThread is considered to be a root for the current renderer context so
+        we need to bail out from the containing block traversal here (like we do for the RenderView). 
+
+        Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+
 2016-11-30  Brady Eidson  <[email protected]>
 
         IndexedDB 2.0: Send operations off to the server in batches instead of one at a time.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (209157 => 209158)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2016-11-30 22:59:28 UTC (rev 209157)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2016-11-30 23:12:45 UTC (rev 209158)
@@ -3141,17 +3141,22 @@
         case Percent:
         case Calculated:
         {
-            auto cb = isOutOfFlowPositioned() ? container() : containingBlock();
-            while (cb && cb->isAnonymous() && !is<RenderView>(*cb)) {
-                cb = cb->containingBlock();
-                downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
+            auto* container = isOutOfFlowPositioned() ? this->container() : containingBlock();
+            while (container && container->isAnonymous()) {
+                // Stop at rendering context root.
+                if (is<RenderView>(*container) || is<RenderNamedFlowThread>(*container))
+                    break;
+                container = container->containingBlock();
+                downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
             }
 
             // FIXME: This calculation is not patched for block-flow yet.
             // https://bugs.webkit.org/show_bug.cgi?id=46500
-            if (cb->isOutOfFlowPositioned() && cb->style().height().isAuto() && !(cb->style().top().isAuto() || cb->style().bottom().isAuto())) {
-                ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock());
-                RenderBlock& block = downcast<RenderBlock>(*cb);
+            if (container->isOutOfFlowPositioned()
+                && container->style().height().isAuto()
+                && !(container->style().top().isAuto() || container->style().bottom().isAuto())) {
+                ASSERT_WITH_SECURITY_IMPLICATION(container->isRenderBlock());
+                auto& block = downcast<RenderBlock>(*container);
                 LogicalExtentComputedValues computedValues;
                 block.computeLogicalHeight(block.logicalHeight(), 0, computedValues);
                 LayoutUnit newContentHeight = computedValues.m_extent - block.borderAndPaddingLogicalHeight() - block.scrollbarLogicalHeight();
@@ -3164,7 +3169,7 @@
             // https://bugs.webkit.org/show_bug.cgi?id=46496
             LayoutUnit availableHeight;
             if (isOutOfFlowPositioned())
-                availableHeight = containingBlockLogicalHeightForPositioned(downcast<RenderBoxModelObject>(*cb));
+                availableHeight = containingBlockLogicalHeightForPositioned(downcast<RenderBoxModelObject>(*container));
             else {
                 availableHeight = containingBlockLogicalHeightForContent(IncludeMarginBorderPadding);
                 // It is necessary to use the border-box to match WinIE's broken
@@ -3172,15 +3177,16 @@
                 // table cells using percentage heights.
                 // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
                 // https://bugs.webkit.org/show_bug.cgi?id=46997
-                while (cb && !is<RenderView>(*cb) && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercentOrCalculated())) {
-                    if (cb->isTableCell()) {
+                while (container && !is<RenderView>(*container)
+                    && (container->style().logicalHeight().isAuto() || container->style().logicalHeight().isPercentOrCalculated())) {
+                    if (container->isTableCell()) {
                         // Don't let table cells squeeze percent-height replaced elements
                         // <http://bugs.webkit.org/show_bug.cgi?id=15359>
                         availableHeight = std::max(availableHeight, intrinsicLogicalHeight());
                         return valueForLength(logicalHeight, availableHeight - borderAndPaddingLogicalHeight());
                     }
-                    downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
-                    cb = cb->containingBlock();
+                    downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
+                    container = container->containingBlock();
                 }
             }
             return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, availableHeight));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to