Changeset 284773 in webkit


Ignore:
Timestamp:
Oct 25, 2021 1:35:23 AM (9 months ago)
Author:
Ziran Sun
Message:

[css-writing-modes] Fix sizing of orthogonal elements with percentage margins
https://bugs.webkit.org/show_bug.cgi?id=231951

Reviewed by Manuel Rego Casasnovas.
Source/WebCore:

This is to modify RenderBox::FillAvailableMeasure() to handle the case of
orthogonal elements when computing the margins. Spec reference is at
https://www.w3.org/TR/css-writing-modes-3/#dimension-mapping

The change is an import of Chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/968522/

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::fillAvailableMeasure const):

LayoutTests:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284766 r284773  
     12021-10-25  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-writing-modes] Fix sizing of orthogonal elements with percentage margins
     4        https://bugs.webkit.org/show_bug.cgi?id=231951
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7       
     8        * TestExpectations: Unskipped 8 tests that are now passing.
     9
    1102021-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
    211
  • trunk/LayoutTests/TestExpectations

    r284747 r284773  
    42304230webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-004.xht [ ImageOnlyFailure ]
    42314231webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthog-vrl-in-htb-008.xht [ ImageOnlyFailure ]
    4232 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-001.html [ ImageOnlyFailure ]
    4233 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-002.html [ ImageOnlyFailure ]
    4234 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-003.html [ ImageOnlyFailure ]
    4235 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-004.html [ ImageOnlyFailure ]
    4236 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-005.html [ ImageOnlyFailure ]
    4237 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-006.html [ ImageOnlyFailure ]
    4238 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-007.html [ ImageOnlyFailure ]
    4239 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-008.html [ ImageOnlyFailure ]
    42404232webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-001.html [ ImageOnlyFailure ]
    42414233webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-002.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r284772 r284773  
     12021-10-25  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-writing-modes] Fix sizing of orthogonal elements with percentage margins
     4        https://bugs.webkit.org/show_bug.cgi?id=231951
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        This is to modify RenderBox::FillAvailableMeasure() to handle the case of
     9        orthogonal elements when computing the margins. Spec reference is at       
     10        https://www.w3.org/TR/css-writing-modes-3/#dimension-mapping
     11
     12        The change is an import of Chromium CL at
     13        https://chromium-review.googlesource.com/c/chromium/src/+/968522/       
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::fillAvailableMeasure const):
     17
    1182021-10-24  Kimmo Kinnunen  <kkinnunen@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r284718 r284773  
    26952695LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const
    26962696{
    2697     marginStart = minimumValueForLength(style().marginStart(), availableLogicalWidth);
    2698     marginEnd = minimumValueForLength(style().marginEnd(), availableLogicalWidth);
     2697    bool isOrthogonalElement = isHorizontalWritingMode() != containingBlock()->isHorizontalWritingMode();
     2698    LayoutUnit availableSizeForResolvingMargin = isOrthogonalElement ? containingBlockLogicalWidthForContent() : availableLogicalWidth;
     2699    marginStart = minimumValueForLength(style().marginStart(), availableSizeForResolvingMargin);
     2700    marginEnd = minimumValueForLength(style().marginEnd(), availableSizeForResolvingMargin);
    26992701    return availableLogicalWidth - marginStart - marginEnd;
    27002702}
Note: See TracChangeset for help on using the changeset viewer.