Title: [287263] trunk
Revision
287263
Author
[email protected]
Date
2021-12-20 08:56:35 -0800 (Mon, 20 Dec 2021)

Log Message

[css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
https://bugs.webkit.org/show_bug.cgi?id=234300

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Replaced
FAIL by PASS expectations for 2 subtests that are passing now.

Source/WebCore:

In order to properly compute the flex container intrinsic width we must layout the orthogonal
children so that we could use the children's block sizes (which are in the flex container
inline axis).

The very same solution was adopted long time ago by the RenderGrid code.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): prelayout orthogonal children.

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287262 => 287263)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-12-20 16:23:17 UTC (rev 287262)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-12-20 16:56:35 UTC (rev 287263)
@@ -1,3 +1,13 @@
+2021-12-14  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
+        https://bugs.webkit.org/show_bug.cgi?id=234300
+
+        Reviewed by Javier Fernandez.
+
+        * web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Replaced
+        FAIL by PASS expectations for 2 subtests that are passing now.
+
 2021-12-16  Vitaly Dyachkov  <[email protected]>
 
         Flexbox ignores margins of absolute positioned children when `align-items: flex-end` or `justify-content: flex-end`

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt (287262 => 287263)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt	2021-12-20 16:23:17 UTC (rev 287262)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt	2021-12-20 16:56:35 UTC (rev 287263)
@@ -1,15 +1,7 @@
 
 PASS .inline-flexbox 1
-FAIL .inline-flexbox 2 assert_equals:
-<div class="inline-flexbox" data-expected-width="20">
-    <div class="vertical" style="line-height: 20px;">Some text</div>
-</div>
-width expected 20 but got 0
-FAIL .inline-flexbox 3 assert_equals:
-<div class="inline-flexbox" data-expected-width="20">
-    <span class="vertical" data-expected-width="20" style="line-height: 20px;">Some text</span>
-</div>
-width expected 20 but got 0
+PASS .inline-flexbox 2
+PASS .inline-flexbox 3
 
 Some text
 

Modified: trunk/Source/WebCore/ChangeLog (287262 => 287263)


--- trunk/Source/WebCore/ChangeLog	2021-12-20 16:23:17 UTC (rev 287262)
+++ trunk/Source/WebCore/ChangeLog	2021-12-20 16:56:35 UTC (rev 287263)
@@ -1,3 +1,19 @@
+2021-12-14  Sergio Villar Senin  <[email protected]>
+
+        [css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
+        https://bugs.webkit.org/show_bug.cgi?id=234300
+
+        Reviewed by Javier Fernandez.
+
+        In order to properly compute the flex container intrinsic width we must layout the orthogonal
+        children so that we could use the children's block sizes (which are in the flex container
+        inline axis).
+
+        The very same solution was adopted long time ago by the RenderGrid code.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): prelayout orthogonal children.
+
 2021-12-20  Karl Dubost  <[email protected]>
 
         Fixes dead code in compareIcons()

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (287262 => 287263)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-12-20 16:23:17 UTC (rev 287262)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2021-12-20 16:56:35 UTC (rev 287263)
@@ -113,6 +113,10 @@
             continue;
         ++numItemsWithNormalLayout;
 
+        // Pre-layout orthogonal children in order to get a valid value for the preferred width.
+        if (style().isHorizontalWritingMode() != child->style().isHorizontalWritingMode())
+            child->layoutIfNeeded();
+
         LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
 
         LayoutUnit minPreferredLogicalWidth;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to