⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286952 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 9:19:12 AM (5 years ago)
Author:
svillar@igalia.com
Message:

[css-writing-modes] Use the correct margins in computeInlinePreferredLogicalWidths in orthogonal flows
https://bugs.webkit.org/show_bug.cgi?id=233562
<rdar://problem/86105904>

Reviewed by Rob Buis.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins-expected.html: Added.
  • web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html: Added.

Source/WebCore:

In order to compute the preferred logical width of an inline element we must compute the preferred widths of
its children. More precisely we should compute the intrinsic size of the children in the inline direction of the
inline element. For parallel flows this means indeed computing the preferred logical width. Translated to
the margins, we should compute the margin-start and margin-end of each child.

However for orthogonal writing modes we should not use the margin-start & margin-end but margin-after and
margin-before. That's why in order to support orthogonal flows we should replace marginStart() usage by
marginStartUsing(parentStyle) (same for marginEnd).

Test: imported/w3c/web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):

LayoutTests:

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286949 r286952  
     12021-12-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-writing-modes] Use the correct margins in computeInlinePreferredLogicalWidths in orthogonal flows
     4        https://bugs.webkit.org/show_bug.cgi?id=233562
     5        <rdar://problem/86105904>
     6
     7        Reviewed by Rob Buis.
     8
     9        * TestExpectations: Unksipped a flexbox test that is now passing.
     10
    1112021-12-13  Antti Koivisto  <antti@apple.com>
    212
  • trunk/LayoutTests/TestExpectations

    r286949 r286952  
    42484248webkit.org/b/221474 imported/w3c/web-platform-tests/css/css-flexbox/svg-root-as-flex-item-002.html [ ImageOnlyFailure ]
    42494249
    4250 # The test works fine but the expected result fails due to a missing layout.
    4251 webkit.org/b/221468 imported/w3c/web-platform-tests/css/css-flexbox/flexbox-align-self-horiz-002.xhtml [ ImageOnlyFailure ]
    4252 
    42534250# align baseline in flexbox.
    42544251webkit.org/b/221478 imported/w3c/web-platform-tests/css/css-flexbox/baseline-synthesis-001.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r286949 r286952  
     12021-12-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-writing-modes] Use the correct margins in computeInlinePreferredLogicalWidths in orthogonal flows
     4        https://bugs.webkit.org/show_bug.cgi?id=233562
     5        <rdar://problem/86105904>
     6
     7        Reviewed by Rob Buis.
     8
     9        * web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins-expected.html: Added.
     10        * web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html: Added.
     11
    1122021-12-13  Antti Koivisto  <antti@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r286951 r286952  
     12021-12-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-writing-modes] Use the correct margins in computeInlinePreferredLogicalWidths in orthogonal flows
     4        https://bugs.webkit.org/show_bug.cgi?id=233562
     5        <rdar://problem/86105904>
     6
     7        Reviewed by Rob Buis.
     8
     9        In order to compute the preferred logical width of an inline element we must compute the preferred widths of
     10        its children. More precisely we should compute the intrinsic size of the children in the inline direction of the
     11        inline element. For parallel flows this means indeed computing the preferred logical width. Translated to
     12        the margins, we should compute the margin-start and margin-end of each child.
     13
     14        However for orthogonal writing modes we should not use the margin-start & margin-end but margin-after and
     15        margin-before. That's why in order to support orthogonal flows we should replace marginStart() usage by
     16        marginStartUsing(parentStyle) (same for marginEnd).
     17
     18        Test: imported/w3c/web-platform-tests/css/css-writing-modes/inline-box-orthogonal-child-with-margins.html
     19
     20        * rendering/RenderBlockFlow.cpp:
     21        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
     22
    1232021-12-13  Alan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r286866 r286952  
    43404340                        lastText = nullptr;
    43414341                    LayoutUnit margins;
    4342                     Length startMargin = childStyle.marginStart();
    4343                     Length endMargin = childStyle.marginEnd();
     4342                    Length startMargin = childStyle.marginStartUsing(&style());
     4343                    Length endMargin = childStyle.marginEndUsing(&style());
    43444344                    if (startMargin.isFixed())
    43454345                        margins += LayoutUnit::fromFloatCeil(startMargin.value());
Note: See TracChangeset for help on using the changeset viewer.