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

Changeset 285923 in webkit


Ignore:
Timestamp:
Nov 17, 2021, 4:31:09 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Limit logical width over-constrained direction check
https://bugs.webkit.org/show_bug.cgi?id=233189

Patch by Rob Buis <rbuis@igalia.com> on 2021-11-17
Reviewed by Sergio Villar Senin.

Source/WebCore:

In computePositionedLogicalWidthUsing the over-constrained case always checks for RTL
direction, but this should not be done if we are not dealing with left and right properties,
i.e. only when we are not orthogonal with the container.
Finally computeLogicalLeftPositionedOffset should not do the flipping logic in the over-constrained case.

  • rendering/RenderBox.cpp:

(WebCore::computeLogicalLeftPositionedOffset):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):

LayoutTests:

  • TestExpectations: Removed 4 tests that are now passing.
  • platform/ios/TestExpectations: Skipped several tests that show 1px diff in the result.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285921 r285923  
     12021-11-17  Rob Buis  <rbuis@igalia.com>
     2
     3        Limit logical width over-constrained direction check
     4        https://bugs.webkit.org/show_bug.cgi?id=233189
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * TestExpectations: Removed 4 tests that are now passing.
     9        * platform/ios/TestExpectations: Skipped several tests that show 1px diff in the result.
     10
    1112021-11-17  Antti Koivisto  <antti@apple.com>
    212
  • trunk/LayoutTests/TestExpectations

    r285921 r285923  
    40354035webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ ImageOnlyFailure ]
    40364036webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ ImageOnlyFailure ]
    4037 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ ImageOnlyFailure ]
    4038 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ ImageOnlyFailure ]
    40394037webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ ImageOnlyFailure ]
    4040 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ ImageOnlyFailure ]
    4041 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ ImageOnlyFailure ]
    40424038webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-001.html [ ImageOnlyFailure ]
    40434039webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-002.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/ios/TestExpectations

    r285620 r285923  
    35333533webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-204.xht [ ImageOnlyFailure ]
    35343534webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ ImageOnlyFailure ]
     3535webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ ImageOnlyFailure ]
     3536webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ ImageOnlyFailure ]
     3537webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ ImageOnlyFailure ]
     3538webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ ImageOnlyFailure ]
    35353539webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/clip-rect-vrl-002.xht [ ImageOnlyFailure ]
    35363540webkit.org/b/229397 imported/w3c/web-platform-tests/css/css-writing-modes/clip-rect-vrl-004.xht [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r285922 r285923  
     12021-11-17  Rob Buis  <rbuis@igalia.com>
     2
     3        Limit logical width over-constrained direction check
     4        https://bugs.webkit.org/show_bug.cgi?id=233189
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        In computePositionedLogicalWidthUsing the over-constrained case always checks for RTL
     9        direction, but this should not be done if we are not dealing with left and right properties,
     10        i.e. only when we are not orthogonal with the container.
     11        Finally computeLogicalLeftPositionedOffset should not do the flipping logic in the over-constrained case.
     12
     13        * rendering/RenderBox.cpp:
     14        (WebCore::computeLogicalLeftPositionedOffset):
     15        (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
     16        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
     17
    1182021-11-17  Antoine Quint  <graouts@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r285885 r285923  
    39903990}
    39913991
    3992 static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const RenderBox* child, LayoutUnit logicalWidthValue, const RenderBoxModelObject& containerBlock, LayoutUnit containerLogicalWidth)
    3993 {
    3994     auto logicalLeftAndRightAreAuto = child->style().logicalLeft().isAuto() && child->style().logicalRight().isAuto();
     3992static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const RenderBox* child, LayoutUnit logicalWidthValue, const RenderBoxModelObject& containerBlock, LayoutUnit containerLogicalWidth, bool logicalLeftIsAuto, bool logicalRightIsAuto)
     3993{
     3994    auto logicalLeftAndRightAreAuto = logicalLeftIsAuto && logicalRightIsAuto;
     3995    bool isOverconstrained = !logicalLeftIsAuto && !logicalRightIsAuto && !child->style().logicalWidth().isAuto();
    39953996    // Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped
    39963997    // along this axis, then we need to flip the coordinate. Auto positioned items do not need this correction as it was properly handled in
    39973998    // computeInlineStaticDistance().
    3998     if (isOrthogonal(*child, containerBlock) && !logicalLeftAndRightAreAuto && containerBlock.style().isFlippedBlocksWritingMode()) {
     3999    if (isOrthogonal(*child, containerBlock) && !logicalLeftAndRightAreAuto && !isOverconstrained && containerBlock.style().isFlippedBlocksWritingMode()) {
    39994000        logicalLeftPos = containerLogicalWidth - logicalWidthValue - logicalLeftPos;
    40004001        logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock.borderRight() : containerBlock.borderBottom());
     
    40904091            // Use the containing block's direction rather than the parent block's
    40914092            // per CSS 2.1 reference test abspos-non-replaced-width-margin-000.
    4092             if (containerDirection == TextDirection::RTL)
     4093            if (!isOrthogonal(*this, containerBlock) && containerDirection == TextDirection::RTL)
    40934094                logicalLeftValue = (availableSpace + logicalLeftValue) - marginLogicalLeftValue - marginLogicalRightValue;
    40944095        }
     
    41944195
    41954196    computedValues.m_position = logicalLeftValue + marginLogicalLeftValue;
    4196     computeLogicalLeftPositionedOffset(computedValues.m_position, this, computedValues.m_extent + bordersPlusPadding, containerBlock, containerLogicalWidth);
     4197    computeLogicalLeftPositionedOffset(computedValues.m_position, this, computedValues.m_extent + bordersPlusPadding, containerBlock, containerLogicalWidth, style().logicalLeft().isAuto(), style().logicalRight().isAuto());
    41974198}
    41984199
     
    46744675    LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias;
    46754676    // Border and padding have already been included in computedValues.m_extent.
    4676     computeLogicalLeftPositionedOffset(logicalLeftPos, this, computedValues.m_extent, containerBlock, containerLogicalWidth);
     4677    computeLogicalLeftPositionedOffset(logicalLeftPos, this, computedValues.m_extent, containerBlock, containerLogicalWidth, style().logicalLeft().isAuto(), style().logicalRight().isAuto());
    46774678    computedValues.m_position = logicalLeftPos;
    46784679}
Note: See TracChangeset for help on using the changeset viewer.