Title: [265497] trunk
Revision
265497
Author
[email protected]
Date
2020-08-11 08:22:27 -0700 (Tue, 11 Aug 2020)

Log Message

LayoutTests/imported/w3c:
[css-flexbox] Only update the intrinsic height if we don't have override height
https://bugs.webkit.org/show_bug.cgi?id=215369

Reviewed by Javier Fernandez.

* web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-010-expected.txt: Replaced failures
by PASS expectations.

Source/WebCore:
[css-flexbox] Only update the intrinsic height if we don't have an override height
https://bugs.webkit.org/show_bug.cgi?id=215369

Reviewed by Javier Fernandez.

If we do have an override height, children will size themselves relative to the override height
(e.g. flexbox flexing/stretching, percentage heights). Because flex intrinsic height is based on
its children, it would then store an incorrect intrinsic height.

This is specially problematic with min-height:auto is nested column flexboxes where flexboxes are
flex items at the same time.

Based on Blink's https://crrev.com/c/1283482 by <[email protected]>

* rendering/RenderBox.cpp:
(WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): Early return if there
is an override height.

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265496 => 265497)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-11 13:27:23 UTC (rev 265496)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-08-11 15:22:27 UTC (rev 265497)
@@ -1,3 +1,13 @@
+2020-08-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Only update the intrinsic height if we don't have override height
+        https://bugs.webkit.org/show_bug.cgi?id=215369
+
+        Reviewed by Javier Fernandez.
+
+        * web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-010-expected.txt: Replaced failures
+        by PASS expectations.
+
 2020-08-10  Clark Wang  <[email protected]>
 
         Add AudioProcessingEvent Constructor

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-010-expected.txt (265496 => 265497)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-010-expected.txt	2020-08-11 13:27:23 UTC (rev 265496)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-010-expected.txt	2020-08-11 15:22:27 UTC (rev 265497)
@@ -1,32 +1,6 @@
 Green rectangle should be entirely within the black rectangle
 
 
-FAIL .container 1 assert_equals: 
-<div id="container" class="container" style="height: 80px;">
-  <div class="flexbox column" style="height: 100%;">
-    <div class="flexbox flex-one">
-        <div class="flexbox column">
-          <div class="flexbox column flex-one">
-            <div class="inner" data-expected-height="80">
-            </div>
-          </div>
-        </div>
-    </div>
-  </div>
-</div>
-height expected 80 but got 300
-FAIL .container 2 assert_equals: 
-<div id="container2" class="container" style="height: 80px;">
-  <div class="flexbox column" style="height: 100%;">
-    <div class="flexbox flex-one">
-        <div class="flexbox column">
-          <div class="flexbox column flex-one">
-            <div class="inner" data-expected-height="80">
-            </div>
-          </div>
-        </div>
-    </div>
-  </div>
-</div>
-height expected 80 but got 300
+PASS .container 1 
+PASS .container 2 
 

Modified: trunk/Source/WebCore/ChangeLog (265496 => 265497)


--- trunk/Source/WebCore/ChangeLog	2020-08-11 13:27:23 UTC (rev 265496)
+++ trunk/Source/WebCore/ChangeLog	2020-08-11 15:22:27 UTC (rev 265497)
@@ -1,3 +1,23 @@
+2020-08-11  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Only update the intrinsic height if we don't have an override height
+        https://bugs.webkit.org/show_bug.cgi?id=215369
+
+        Reviewed by Javier Fernandez.
+
+        If we do have an override height, children will size themselves relative to the override height
+        (e.g. flexbox flexing/stretching, percentage heights). Because flex intrinsic height is based on
+        its children, it would then store an incorrect intrinsic height.
+
+        This is specially problematic with min-height:auto is nested column flexboxes where flexboxes are
+        flex items at the same time.
+
+        Based on Blink's https://crrev.com/c/1283482 by <[email protected]>
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): Early return if there
+        is an override height.
+
 2020-08-11  Andres Gonzalez  <[email protected]>
 
         Update the isolated tree on element language changes.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (265496 => 265497)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2020-08-11 13:27:23 UTC (rev 265496)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2020-08-11 15:22:27 UTC (rev 265497)
@@ -2778,7 +2778,10 @@
 
 void RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem(LayoutUnit height) const
 {
-    if (isFloatingOrOutOfFlowPositioned() || !parent() || !parent()->isFlexibleBox())
+    // FIXME: it should be enough with checking hasOverrideContentLogicalHeight() as this logic could be shared
+    // by any layout system using overrides like grid or flex. However this causes a never ending sequence of calls
+    // between layoutBlock() <-> relayoutToAvoidWidows().
+    if (isFloatingOrOutOfFlowPositioned() || !parent() || !parent()->isFlexibleBox() || hasOverrideContentLogicalHeight())
         return;
     downcast<RenderFlexibleBox>(parent())->setCachedChildIntrinsicContentLogicalHeight(*this, height);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to