Changeset 273206 in webkit


Ignore:
Timestamp:
Feb 20, 2021 2:40:54 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

"min-content" & "max-content" keywords should behave as initial value in block axis (but WebKit improperly treats them as the content-size)
https://bugs.webkit.org/show_bug.cgi?id=191390

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

LayoutTests/imported/w3c:

Update improved test expectation.

  • web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/min-inline-size-expected.txt:

Source/WebCore:

"min-content" & "max-content" should use automatic size in block direction [1].

This behavior matches Gecko and Blink.

[1] https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::constrainLogicalHeightByMinMax const):

LayoutTests:

Adapt test to new behavior.

  • fast/css-intrinsic-dimensions/height-expected.html: Removed.
  • fast/css-intrinsic-dimensions/height.html: Removed.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r273204 r273206  
     12021-02-20  Rob Buis  <rbuis@igalia.com>
     2
     3        "min-content" & "max-content" keywords should behave as initial value in block axis (but WebKit improperly treats them as the content-size)
     4        https://bugs.webkit.org/show_bug.cgi?id=191390
     5
     6        Reviewed by Darin Adler.
     7
     8        Adapt test to new behavior.
     9
     10        * fast/css-intrinsic-dimensions/height-expected.html: Removed.
     11        * fast/css-intrinsic-dimensions/height.html: Removed.
     12
    1132021-02-20  Kimmo Kinnunen  <kkinnunen@apple.com>
    214
  • trunk/LayoutTests/fast/css-intrinsic-dimensions/height-expected.html

    r185908 r273206  
    4141
    4242<div class="container">
    43   <div>
     43  <div style="height: 1px">
    4444    min-height: min-content<br>on this box.
    4545  </div>
    4646
    47   <div>
     47  <div style="height: 1px">
    4848    min-height: max-content<br>on this box.
    4949  </div>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r273203 r273206  
     12021-02-20  Rob Buis  <rbuis@igalia.com>
     2
     3        "min-content" & "max-content" keywords should behave as initial value in block axis (but WebKit improperly treats them as the content-size)
     4        https://bugs.webkit.org/show_bug.cgi?id=191390
     5
     6        Reviewed by Darin Adler.
     7
     8        Update improved test expectation.
     9
     10        * web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/min-inline-size-expected.txt:
     11
    1122021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/min-inline-size-expected.txt

    r267646 r273206  
    44
    55PASS horizontal-tb
    6 FAIL vertical-lr  assert_equals: width expected "0px" but got "100px"
    7 FAIL vertical-rl  assert_equals: width expected "0px" but got "100px"
     6FAIL vertical-lr  assert_equals: height expected "100px" but got "0px"
     7FAIL vertical-rl  assert_equals: height expected "100px" but got "0px"
    88PASS horizontal-tb override
    9 FAIL vertical-lr override assert_equals: width expected "0px" but got "100px"
    10 FAIL vertical-rl override assert_equals: width expected "0px" but got "100px"
     9PASS vertical-lr override
     10PASS vertical-rl override
    1111
  • trunk/Source/WebCore/ChangeLog

    r273205 r273206  
     12021-02-20  Rob Buis  <rbuis@igalia.com>
     2
     3        "min-content" & "max-content" keywords should behave as initial value in block axis (but WebKit improperly treats them as the content-size)
     4        https://bugs.webkit.org/show_bug.cgi?id=191390
     5
     6        Reviewed by Darin Adler.
     7
     8        "min-content" & "max-content" should use automatic size in block direction [1].
     9
     10        This behavior matches Gecko and Blink.
     11
     12        [1] https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content
     13
     14        * rendering/RenderBox.cpp:
     15        (WebCore::RenderBox::constrainLogicalHeightByMinMax const):
     16
    1172021-02-20  Lauro Moura  <lmoura@igalia.com>
    218
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r273193 r273206  
    682682    if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible)
    683683        logicalMinHeight = Length(*intrinsicContentHeight, LengthType::Fixed);
     684    if (logicalMinHeight.isMinContent() || logicalMinHeight.isMaxContent())
     685        logicalMinHeight = Length();
    684686    if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, logicalMinHeight, intrinsicContentHeight))
    685687        return std::max(logicalHeight, computedLogicalHeight.value());
Note: See TracChangeset for help on using the changeset viewer.