[css-grid] Use max size to compute auto repeat tracks
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 15:08:46 +0000 (15:08 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 15:08:46 +0000 (15:08 +0000)
commitc9c27a27a236b114ca4a79b733fa4e90efc78c4a
tree33dd9cd9d2643710290bbc0bdec000e524936b86
parent6f992ffb2d93d19e022a88a3a9a54b52a57dcab1
[css-grid] Use max size to compute auto repeat tracks
https://bugs.webkit.org/show_bug.cgi?id=197854

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported WPT tests for this bug.

* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

When available size is indefinite we should use max size to compute the number of auto repeat tracks.

The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
> When auto-fill is given as the repetition number, if the grid container
> has a definite size or **max size** in the relevant axis...

So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
to do the same than for heights.

We also take advantage to fix problems related to min|max sizes and box-sizing property,
that were inconsistent for columns and rows.

Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp