Changeset 284548 in webkit


Ignore:
Timestamp:
Oct 20, 2021 10:35:18 AM (9 months ago)
Author:
commit-queue@webkit.org
Message:

Fix percentages on orthogonal replaced children
https://bugs.webkit.org/show_bug.cgi?id=46496

Patch by Rob Buis <rbuis@igalia.com> on 2021-10-20
Reviewed by Darin Adler.

Source/WebCore:

Modify computeReplacedLogicalWidthUsing to make it aware of the orthogonal flow case
when dealing with calc/percentages.

This patch also removes an outdated comment from computeReplacedLogicalHeightUsing.

Test: imported/w3c/web-platform-tests/wpt/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing const):

LayoutTests:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284546 r284548  
     12021-10-20  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix percentages on orthogonal replaced children
     4        https://bugs.webkit.org/show_bug.cgi?id=46496
     5
     6        Reviewed by Darin Adler.
     7
     8        * TestExpectations:
     9
    1102021-10-20  Ayumi Kojima  <ayumi_kojima@apple.com>
    211
  • trunk/LayoutTests/TestExpectations

    r284530 r284548  
    41054105webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-007.html [ ImageOnlyFailure ]
    41064106webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-orthogonal-percentage-margin-008.html [ ImageOnlyFailure ]
    4107 webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001.html [ ImageOnlyFailure ]
    41084107webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-001.html [ ImageOnlyFailure ]
    41094108webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/table-cell-002.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r284544 r284548  
     12021-10-20  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix percentages on orthogonal replaced children
     4        https://bugs.webkit.org/show_bug.cgi?id=46496
     5
     6        Reviewed by Darin Adler.
     7
     8        Modify computeReplacedLogicalWidthUsing to make it aware of the orthogonal flow case
     9        when dealing with calc/percentages.
     10
     11        This patch also removes an outdated comment from computeReplacedLogicalHeightUsing.
     12
     13        Test: imported/w3c/web-platform-tests/wpt/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001.html
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
     17        (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
     18
    1192021-10-20  Ross Kirsling  <ross.kirsling@sony.com>
    220
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r284440 r284548  
    33263326    case LengthType::Percent:
    33273327    case LengthType::Calculated: {
    3328         // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
    3329         // containing block's block-flow.
    3330         // https://bugs.webkit.org/show_bug.cgi?id=46496
    3331         const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWidthForPositioned(downcast<RenderBoxModelObject>(*container())) : containingBlockLogicalWidthForContent();
     3328        LayoutUnit containerWidth;
     3329        if (isOutOfFlowPositioned())
     3330            containerWidth = containingBlockLogicalWidthForPositioned(downcast<RenderBoxModelObject>(*container()));
     3331        else if (isHorizontalWritingMode() == containingBlock()->isHorizontalWritingMode())
     3332            containerWidth = containingBlockLogicalWidthForContent();
     3333        else
     3334            containerWidth = perpendicularContainingBlockLogicalHeight();
    33323335        Length containerLogicalWidth = containingBlock()->style().logicalWidth();
    33333336        // FIXME: Handle cases when containing block width is calculated or viewport percent.
    33343337        // https://bugs.webkit.org/show_bug.cgi?id=91071
    33353338        if (logicalWidth.isIntrinsic())
    3336             return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
    3337         if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated())))
    3338             return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw), logicalWidth.type());
     3339            return computeIntrinsicLogicalWidthUsing(logicalWidth, containerWidth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
     3340        if (containerWidth > 0 || (!containerWidth && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated())))
     3341            return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, containerWidth), logicalWidth.type());
    33393342        return 0_lu;
    33403343    }
     
    34733476        }
    34743477       
    3475         // FIXME: availableLogicalHeight() is wrong if the replaced element's block-flow is perpendicular to the
    3476         // containing block's block-flow.
    3477         // https://bugs.webkit.org/show_bug.cgi?id=46496
    34783478        LayoutUnit availableHeight;
    34793479        if (isOutOfFlowPositioned())
Note: See TracChangeset for help on using the changeset viewer.