Changeset 265020 in webkit


Ignore:
Timestamp:
Jul 28, 2020 4:41:05 PM (4 years ago)
Author:
Oriol Brufau
Message:

[css-grid] Fix 'align-content' in grid containers with small content area
https://bugs.webkit.org/show_bug.cgi?id=214370

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Create a WPT test and import another one.

  • web-platform-tests/css/css-grid/alignment/grid-place-content-001-expected.txt: Added.
  • web-platform-tests/css/css-grid/alignment/grid-place-content-001.html: Added.
  • web-platform-tests/css/css-sizing/available-height-for-replaced-content-001-expected.txt: Added.
  • web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html: Added.
  • web-platform-tests/css/css-sizing/w3c-import.log:

Source/WebCore:

In order to properly obey 'align-content', grid containers need to know
the available grid space for the block axis. But there was a bug when
the sum of border and padding sizes in the block axis were bigger than
the content area. Then the available space was considered to be that sum.

This patch fixes it so that the available grid space is the size of its
content box when that is definite.

Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-place-content-001.html

imported/w3c/web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::availableLogicalHeight const):

Location:
trunk
Files:
4 added
4 edited

Legend:

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

    r265014 r265020  
     12020-07-28  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-grid] Fix 'align-content' in grid containers with small content area
     4        https://bugs.webkit.org/show_bug.cgi?id=214370
     5
     6        Reviewed by Darin Adler.
     7
     8        Create a WPT test and import another one.
     9
     10        * web-platform-tests/css/css-grid/alignment/grid-place-content-001-expected.txt: Added.
     11        * web-platform-tests/css/css-grid/alignment/grid-place-content-001.html: Added.
     12        * web-platform-tests/css/css-sizing/available-height-for-replaced-content-001-expected.txt: Added.
     13        * web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html: Added.
     14        * web-platform-tests/css/css-sizing/w3c-import.log:
     15
    1162020-07-28  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/w3c-import.log

    r264522 r265020  
    1919/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/auto-scrollbar-inside-stf-abspos-expected.html
    2020/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/auto-scrollbar-inside-stf-abspos.html
     21/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html
    2122/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/block-fit-content-as-initial-expected.html
    2223/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/block-fit-content-as-initial.html
  • trunk/Source/WebCore/ChangeLog

    r265019 r265020  
     12020-07-28  Oriol Brufau  <obrufau@igalia.com>
     2
     3        [css-grid] Fix 'align-content' in grid containers with small content area
     4        https://bugs.webkit.org/show_bug.cgi?id=214370
     5
     6        Reviewed by Darin Adler.
     7
     8        In order to properly obey 'align-content', grid containers need to know
     9        the available grid space for the block axis. But there was a bug when
     10        the sum of border and padding sizes in the block axis were bigger than
     11        the content area. Then the available space was considered to be that sum.
     12
     13        This patch fixes it so that the available grid space is the size of its
     14        content box when that is definite.
     15
     16        Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-place-content-001.html
     17               imported/w3c/web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html
     18
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::availableLogicalHeight const):
     21
    1222020-07-28  Peng Liu  <peng.liu6@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r263389 r265020  
    32503250LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
    32513251{
    3252     return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), WTF::nullopt);
     3252    return constrainContentBoxLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), WTF::nullopt);
    32533253}
    32543254
Note: See TracChangeset for help on using the changeset viewer.