Title: [267572] trunk
Revision
267572
Author
[email protected]
Date
2020-09-25 09:05:45 -0700 (Fri, 25 Sep 2020)

Log Message

[LFC][Out-of-flow] ASSERTION FAILED: !layoutBox.isOutOfFlowPositioned() in WebCore::Layout::FormattingContext::Geometry::computedHeightValue
https://bugs.webkit.org/show_bug.cgi?id=216976

Reviewed by Antti Koivisto.

Source/WebCore:

Geometry::computedHeightValue is a simple resolver function. It should not really care about
whether the box's containing block has valid vertical geometry. The callsite (where this assert is important) is already testing this condition.

Test: fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
(WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):

LayoutTests:

* fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple-expected.html: Added.
* fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (267571 => 267572)


--- trunk/LayoutTests/ChangeLog	2020-09-25 15:22:00 UTC (rev 267571)
+++ trunk/LayoutTests/ChangeLog	2020-09-25 16:05:45 UTC (rev 267572)
@@ -1,3 +1,13 @@
+2020-09-25  Zalan Bujtas  <[email protected]>
+
+        [LFC][Out-of-flow] ASSERTION FAILED: !layoutBox.isOutOfFlowPositioned() in WebCore::Layout::FormattingContext::Geometry::computedHeightValue
+        https://bugs.webkit.org/show_bug.cgi?id=216976
+
+        Reviewed by Antti Koivisto.
+
+        * fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple-expected.html: Added.
+        * fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html: Added.
+
 2020-09-25  Antoine Quint  <[email protected]>
 
         Reduce the reliance on PseudoElement in the animation code

Added: trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple-expected.html (0 => 267572)


--- trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple-expected.html	2020-09-25 16:05:45 UTC (rev 267572)
@@ -0,0 +1,9 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+div {
+  width: 100px; 
+  height: 100px;
+  background-color: green;
+}
+</style>
+<div></div>

Added: trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html (0 => 267572)


--- trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html	2020-09-25 16:05:45 UTC (rev 267572)
@@ -0,0 +1,17 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:LayoutFormattingContextEnabled=true internal:LayoutFormattingContextIntegrationEnabled=false ] -->
+<style>
+.container {
+  position: relative;
+  height: 200px;
+}
+
+.child {
+  width: 100px; 
+  height: 50%;
+  position: absolute; 
+  top: 0px;
+  left: 0px;
+  background-color: green;
+}
+</style>
+<div class=container><div class=child><div></div></div></div>

Modified: trunk/Source/WebCore/ChangeLog (267571 => 267572)


--- trunk/Source/WebCore/ChangeLog	2020-09-25 15:22:00 UTC (rev 267571)
+++ trunk/Source/WebCore/ChangeLog	2020-09-25 16:05:45 UTC (rev 267572)
@@ -1,3 +1,22 @@
+2020-09-25  Zalan Bujtas  <[email protected]>
+
+        [LFC][Out-of-flow] ASSERTION FAILED: !layoutBox.isOutOfFlowPositioned() in WebCore::Layout::FormattingContext::Geometry::computedHeightValue
+        https://bugs.webkit.org/show_bug.cgi?id=216976
+
+        Reviewed by Antti Koivisto.
+
+        Geometry::computedHeightValue is a simple resolver function. It should not really care about
+        whether the box's containing block has valid vertical geometry. The callsite (where this assert is important) is already testing this condition.
+
+        Test: fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html
+
+        * layout/FormattingContext.h:
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
+        (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
+
 2020-09-25  Antoine Quint  <[email protected]>
 
         Reduce the reliance on PseudoElement in the animation code

Modified: trunk/Source/WebCore/layout/FormattingContext.h (267571 => 267572)


--- trunk/Source/WebCore/layout/FormattingContext.h	2020-09-25 15:22:00 UTC (rev 267571)
+++ trunk/Source/WebCore/layout/FormattingContext.h	2020-09-25 16:05:45 UTC (rev 267572)
@@ -40,7 +40,6 @@
 
 namespace Layout {
 
-class Box;
 class BoxGeometry;
 class ReplacedBox;
 struct ComputedHorizontalMargin;

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (267571 => 267572)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-09-25 15:22:00 UTC (rev 267571)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-09-25 16:05:45 UTC (rev 267572)
@@ -74,8 +74,6 @@
         return LayoutUnit { height.value() };
 
     if (!containingBlockHeight) {
-        // Containing block's height is already computed since we layout the out-of-flow boxes as the last step.
-        ASSERT(!layoutBox.isOutOfFlowPositioned());
         if (layoutState().inQuirksMode())
             containingBlockHeight = formattingContext().quirks().heightValueOfNearestContainingBlockWithFixedHeight(layoutBox);
         else {
@@ -1174,7 +1172,6 @@
 FormattingContext::ConstraintsForInFlowContent FormattingContext::Geometry::constraintsForInFlowContent(const ContainerBox& containerBox, Optional<EscapeReason> escapeReason)
 {
     auto& boxGeometry = formattingContext().geometryForBox(containerBox, escapeReason);
-    // FIXME: Find out if min/max-height properties should also be taken into account here.
     return { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), computedHeight(containerBox) } };
 }
 

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (267571 => 267572)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2020-09-25 15:22:00 UTC (rev 267571)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2020-09-25 16:05:45 UTC (rev 267572)
@@ -147,7 +147,7 @@
 
             auto establishesFormattingContext = layoutBox.establishesFormattingContext(); 
             if (establishesFormattingContext) {
-                // Now that we computed the root's height, we can layout the out-of-flow descendants.
+                // Now that we computed the box's height, we can layout the out-of-flow descendants.
                 if (is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasChild()) {
                     auto& containerBox = downcast<ContainerBox>(layoutBox);
                     LayoutContext::createFormattingContext(containerBox, layoutState())->layoutOutOfFlowContent(invalidationState, geometry().constraintsForOutOfFlowContent(containerBox));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to