Changeset 272309 in webkit


Ignore:
Timestamp:
Feb 3, 2021 6:04:58 AM (18 months ago)
Author:
commit-queue@webkit.org
Message:

[css-grid] max-height percentages are wrongly resolved for replaced grid items
https://bugs.webkit.org/show_bug.cgi?id=220733

Patch by Ziran Sun <Ziran Sun> on 2021-02-03
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

The following tests are imported from WPT.

  • web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001-expected.html: Added.
  • web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html: Added.

Source/WebCore:

Make replacedMinMaxLogicalHeightComputesAsNone check the override cb height. If the
override height is indefinite, this function should return true. Otherwise returns false.

This is an import of Chromium changes at
https://chromium-review.googlesource.com/c/chromium/src/+/2100771
and
https://chromium-review.googlesource.com/c/chromium/src/+/2287370.
The Chromium code checks on Quirks mode. In WebKit, this check doesn't seem making any
impact.
Test percentage-max-height-001.html already works in WebKit without this change. Test
percentage-max-height-002.html is not ported as it still doesn't work even with this
change. This change intends to fix the grid bug raised.

Test grid-img-item-percent-max-height-001.html was ported to WPT at
https://github.com/web-platform-tests/wpt/commit/4816b3d70f98777afd1757995af84c3adc67d433

Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone const):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r272302 r272309  
     12021-02-03  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] max-height percentages are wrongly resolved for replaced grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=220733
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        The following tests are imported from WPT.
     9        * web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001-expected.html: Added.
     10        * web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html: Added.
     11
    1122021-02-03  Ziran Sun  <zsun@igalia.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log

    r271745 r272309  
    2020/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/explicitly-sized-grid-item-as-table.html
    2121/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.html
     22/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html
    2223/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-inline-items-001-expected.xht
    2324/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-inline-items-001.html
  • trunk/Source/WebCore/ChangeLog

    r272308 r272309  
     12021-02-03  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] max-height percentages are wrongly resolved for replaced grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=220733
     5
     6        Reviewed by Manuel Rego Casasnovas.
     7
     8        Make replacedMinMaxLogicalHeightComputesAsNone check the override cb height. If the
     9        override height is indefinite, this function should return true. Otherwise returns false.
     10
     11        This is an import of Chromium changes at
     12        https://chromium-review.googlesource.com/c/chromium/src/+/2100771
     13        and
     14        https://chromium-review.googlesource.com/c/chromium/src/+/2287370.
     15        The Chromium code checks on Quirks mode. In WebKit, this check doesn't seem making any
     16        impact.
     17        Test percentage-max-height-001.html already works in WebKit without this change. Test
     18        percentage-max-height-002.html is not ported as it still doesn't work even with this
     19        change. This change intends to fix the grid bug raised.
     20
     21        Test grid-img-item-percent-max-height-001.html was ported to WPT at
     22        https://github.com/web-platform-tests/wpt/commit/4816b3d70f98777afd1757995af84c3adc67d433
     23
     24        Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-img-item-percent-max-height-001.html
     25
     26        * rendering/RenderBox.cpp:
     27        (WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone const):
     28
    1292021-02-03  Ziran Sun  <zsun@igalia.com>
    230
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r272049 r272309  
    32483248        return true;
    32493249   
     3250    if (logicalHeight.isPercentOrCalculated() && hasOverridingContainingBlockContentLogicalHeight())
     3251        return overridingContainingBlockContentLogicalHeight() == LayoutUnit(-1);
     3252
    32503253    // Make sure % min-height and % max-height resolve to none if the containing block has auto height.
    32513254    // Note that the "height" case for replaced elements was handled by hasReplacedLogicalHeight, which is why
Note: See TracChangeset for help on using the changeset viewer.