[css-grid] Apply automatic minimum size clamping to spanning items too
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Feb 2018 12:10:16 +0000 (12:10 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Feb 2018 12:10:16 +0000 (12:10 +0000)
commit5ff07e5b10ad24e9e8af3218432b9b86b91dca2e
treecd7f0325989dcca508d3990bc585c36668ea680d
parente6ff51324372dc86eca426075e2c02805ffe0a8a
[css-grid] Apply automatic minimum size clamping to spanning items too
https://bugs.webkit.org/show_bug.cgi?id=182684

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Update WPT tests related to this change.

* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022.html:
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023.html:
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html: Added.
* web-platform-tests/css/css-grid/grid-items/w3c-import.log:

Source/WebCore:

In r225776 we added the conditions from the spec to apply
the automatic minimum size clamping when required
but only to non-spanning items.
See: https://drafts.csswg.org/css-grid/#min-size-auto

This patch moves the code from GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem()
to GridTrackSizingAlgorithmStrategy::minSizeForChild()
that way the clamping is applied for both spanning and non-spanning items.

This somehow reverts r225776, as it was adding some duplicated code.
All the checks to know if we should use that part of the spec
were already present in GridTrackSizingAlgorithmStrategy::minSizeForChild().

Apart from using the previous code, there's a new loop to verify
that the max track sizing function is fixed for all the tracks of the item.

Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
       imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022.html
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023.html
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp