Changeset 273955 in webkit


Ignore:
Timestamp:
Mar 5, 2021 2:14:57 AM (17 months ago)
Author:
svillar@igalia.com
Message:

WPT test css/css-flexbox/flex-minimum-height-flex-items-023.html fails
https://bugs.webkit.org/show_bug.cgi?id=214292

Reviewed by Javier Fernandez.

Source/WebCore:

CSS flex specs define how to compute the main axis automatic minimum size of a flex item in order to
provide a more reasonable minimum size (as grid does). So far we've considered "automatic minimum size"
as either min-{width|height}:auto. However the css-sizing-3 specs mention that for the block size
either min-content, max-content or fit-content are (unless otherwise specified) equivalent to the
automatic size (see https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content).

This means that we need to expand our check to consider those intrinsic sizes as automatic whenever the
block axis of the flex item is the flexbible box main size.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::shouldApplyMinSizeAutoForChild const): Consider intrinsic sizes as automatic
in case the child block axis is the flex container main axis.
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Let intrinsic sizes be handled by the code
that computes min-size:auto.

LayoutTests:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r273952 r273955  
     12021-03-01  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        WPT test css/css-flexbox/flex-minimum-height-flex-items-023.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=214292
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * TestExpectations: Unskipped the test that passes now.
     9
    1102021-03-05  Rob Buis  <rbuis@igalia.com>
    211
  • trunk/LayoutTests/TestExpectations

    r273952 r273955  
    41274127http/tests/websocket/tests/hybi/closed-port-delay.html [ Skip ]
    41284128
    4129 webkit.org/b/214292 imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum-height-flex-items-023.html [ ImageOnlyFailure ]
    4130 
    41314129webkit.org/b/214291 imported/w3c/web-platform-tests/css/css-writing-modes/abs-pos-with-replaced-child.html [ ImageOnlyFailure ]
    41324130webkit.org/b/214291 imported/w3c/web-platform-tests/css/css-writing-modes/available-size-004.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r273954 r273955  
     12021-03-01  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        WPT test css/css-flexbox/flex-minimum-height-flex-items-023.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=214292
     5
     6        Reviewed by Javier Fernandez.
     7
     8        CSS flex specs define how to compute the main axis automatic minimum size of a flex item in order to
     9        provide a more reasonable minimum size (as grid does). So far we've considered "automatic minimum size"
     10        as either min-{width|height}:auto. However the css-sizing-3 specs mention that for the block size
     11        either min-content, max-content or fit-content are (unless otherwise specified) equivalent to the
     12        automatic size (see https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content).
     13
     14        This means that we need to expand our check to consider those intrinsic sizes as automatic whenever the
     15        block axis of the flex item is the flexbible box main size.
     16
     17        * rendering/RenderFlexibleBox.cpp:
     18        (WebCore::RenderFlexibleBox::shouldApplyMinSizeAutoForChild const): Consider intrinsic sizes as automatic
     19        in case the child block axis is the flex container main axis.
     20        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Let intrinsic sizes be handled by the code
     21        that computes min-size:auto.
     22
    1232021-03-05  Philippe Normand  <pnormand@igalia.com>
    224
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r273952 r273955  
    425425}
    426426
     427// https://drafts.csswg.org/css-flexbox/#min-size-auto
    427428bool RenderFlexibleBox::shouldApplyMinSizeAutoForChild(const RenderBox& child) const
    428429{
    429     // css-flexbox section 4.5
    430430    auto minSize = mainSizeLengthForChild(MinSize, child);
    431     return minSize.isAuto() && mainAxisOverflowForChild(child) == Overflow::Visible;
     431    // min, max and fit-content are equivalent to the automatic size for block sizes https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content.
     432    bool childBlockSizeIsEquivalentToAutomaticSize  = !mainAxisIsChildInlineAxis(child) && (minSize.isMinContent() || minSize.isMaxContent() || minSize.isFitContent());
     433
     434    return (minSize.isAuto() || childBlockSizeIsEquivalentToAutomaticSize) && (mainAxisOverflowForChild(child) == Overflow::Visible);
    432435}
    433436
     
    11981201
    11991202    Length min = mainSizeLengthForChild(MinSize, child);
    1200     if (min.isSpecifiedOrIntrinsic())
     1203    // Intrinsic sizes in child's block axis are handled by the min-size:auto code path.
     1204    if (min.isSpecified() || (min.isIntrinsic() && mainAxisIsChildInlineAxis(child)))
    12011205        return std::max(childSize, std::max(0_lu, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize)));
    12021206   
Note: See TracChangeset for help on using the changeset viewer.