Changeset 282340 in webkit


Ignore:
Timestamp:
Sep 13, 2021 11:15:52 AM (10 months ago)
Author:
Ziran Sun
Message:

[css-grid] calling correct offset function for RTL for out of flow child
https://bugs.webkit.org/show_bug.cgi?id=229968

Reviewed by Javier Fernandez.

Handle RTL case to return the correct border values when calculating offsets for start and end edges
of a column for out of flow child.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-alignment-positioned-items-with-margin-border-padding-016-expected.txt

    r279269 r282340  
    2424
    2525PASS .grid 1
    26 FAIL .grid 2 assert_equals:
    27 <div class="grid RTL">
    28   <div data-offset-x="377" data-offset-y="3" data-expected-width="76" data-expected-height="20" class="firstRowFirstColumn">X XX X</div>
    29   <div data-offset-x="86" data-offset-y="105" data-expected-width="86" data-expected-height="40" class="firstRowSecondColumn">XX X<br>X XXX X<br>XX XXX</div>
    30   <div data-offset-x="377" data-offset-y="189" data-expected-width="76" data-expected-height="20" class="secondRowFirstColumn">X XX X</div>
    31   <div data-offset-x="261" data-offset-y="195" data-expected-width="76" data-expected-height="50" class="secondRowSecondColumn">XX X<br>X XXX<br>X<br>XX XXX</div>
    32 </div>
    33 offsetLeft expected 377 but got 375
     26PASS .grid 2
    3427PASS .grid 3
    3528PASS .grid 4
  • trunk/Source/WebCore/ChangeLog

    r282339 r282340  
     12021-09-13  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] calling correct offset function for RTL for out of flow child
     4        https://bugs.webkit.org/show_bug.cgi?id=229968
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Handle RTL case to return the correct border values when calculating offsets for start and end edges
     9        of a column for out of flow child.
     10
     11        * rendering/RenderGrid.cpp:
     12        (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
     13
    1142021-09-13  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r282008 r282340  
    15791579    auto& positions = isRowAxis ? m_columnPositions : m_rowPositions;
    15801580    auto& outOfFlowItemLine = isRowAxis ? m_outOfFlowItemColumn : m_outOfFlowItemRow;
    1581     LayoutUnit borderEdge = isRowAxis ? borderLogicalLeft() : borderBefore();
     1581    LayoutUnit borderEdge = isRowAxis ? (style().isLeftToRightDirection() ? borderLogicalLeft() : borderLogicalRight()) : borderBefore();
    15821582    if (startIsAuto)
    15831583        start = resolveAutoStartGridPosition(direction) + borderEdge;
     
    16271627    bool isRowAxis = direction == ForColumns;
    16281628    auto& outOfFlowItemLine = isRowAxis ? m_outOfFlowItemColumn : m_outOfFlowItemRow;
    1629     start = isRowAxis ? borderLogicalLeft() : borderBefore();
     1629    start = isRowAxis ? (style().isLeftToRightDirection() ? borderLogicalLeft() : borderLogicalRight()) : borderBefore();
    16301630    if (auto line = outOfFlowItemLine.get(&child)) {
    16311631        auto& positions = isRowAxis ? m_columnPositions : m_rowPositions;
Note: See TracChangeset for help on using the changeset viewer.