[css-grid] Handle indefinite percentages in fit-content()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 23:40:50 +0000 (23:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 23:40:50 +0000 (23:40 +0000)
commit17707ad4ee590c28a4b469dfc7db929d0ad8a1a3
treea38bb7142ebbc1fc72de5ad8a3e50307bb129178
parentf88ac67a0b36727df21e5bdcb9cdc217f8bad4c7
[css-grid] Handle indefinite percentages in fit-content()
https://bugs.webkit.org/show_bug.cgi?id=194509

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-02-18
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage-expected.txt: Added.
* web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html: Added.
* web-platform-tests/css/css-grid/layout-algorithm/w3c-import.log:

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html

If the size of the grid container depends on the size of its tracks,
a percentage in fit-content() is indefinite. Without this patch, some
places treated this case as fit-content(0), which prevented the grid
container from growing enough to contain the max-content contribution
of its grid items.

This patch treats such fit-content() as minmax(auto, max-content),
but once the size of the grid container is known and it is laid out
"for real", then the percentage is definite and it's used.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp