Changeset 287263 in webkit


Ignore:
Timestamp:
Dec 20, 2021 8:56:35 AM (7 months ago)
Author:
svillar@igalia.com
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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287128 r287263  
     12021-12-14  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
     4        https://bugs.webkit.org/show_bug.cgi?id=234300
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt: Replaced
     9        FAIL by PASS expectations for 2 subtests that are passing now.
     10
    1112021-12-16  Vitaly Dyachkov  <obyknovenius@me.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-width-orthogonal-writing-mode-expected.txt

    r267650 r287263  
    11
    22PASS .inline-flexbox 1
    3 FAIL .inline-flexbox 2 assert_equals:
    4 <div class="inline-flexbox" data-expected-width="20">
    5     <div class="vertical" style="line-height: 20px;">Some text</div>
    6 </div>
    7 width expected 20 but got 0
    8 FAIL .inline-flexbox 3 assert_equals:
    9 <div class="inline-flexbox" data-expected-width="20">
    10     <span class="vertical" data-expected-width="20" style="line-height: 20px;">Some text</span>
    11 </div>
    12 width expected 20 but got 0
     3PASS .inline-flexbox 2
     4PASS .inline-flexbox 3
    135
    146Some text
  • trunk/Source/WebCore/ChangeLog

    r287262 r287263  
     12021-12-14  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-flexbox] Pre-layout orthogonal children to compute the preferred logical width
     4        https://bugs.webkit.org/show_bug.cgi?id=234300
     5
     6        Reviewed by Javier Fernandez.
     7
     8        In order to properly compute the flex container intrinsic width we must layout the orthogonal
     9        children so that we could use the children's block sizes (which are in the flex container
     10        inline axis).
     11
     12        The very same solution was adopted long time ago by the RenderGrid code.
     13
     14        * rendering/RenderFlexibleBox.cpp:
     15        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): prelayout orthogonal children.
     16
    1172021-12-20  Karl Dubost  <karl+github@la-grange.net>
    218
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r287128 r287263  
    113113            continue;
    114114        ++numItemsWithNormalLayout;
     115
     116        // Pre-layout orthogonal children in order to get a valid value for the preferred width.
     117        if (style().isHorizontalWritingMode() != child->style().isHorizontalWritingMode())
     118            child->layoutIfNeeded();
    115119
    116120        LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
Note: See TracChangeset for help on using the changeset viewer.