[css-grid] Fix grid container sizing under min-content height
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2018 08:06:52 +0000 (08:06 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2018 08:06:52 +0000 (08:06 +0000)
commitdfbcb7312b56acb902b635b917dc502aae32bfff
treed6686c3867bae09dea417b9d8778db3556a8674f
parent2c68081fd29739ac7d4b9ab46479881d38edaa90
[css-grid] Fix grid container sizing under min-content height
https://bugs.webkit.org/show_bug.cgi?id=191889

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported tests from WPT.

* web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html: Added.
* web-platform-tests/css/css-grid/grid-model/w3c-import.log:

Source/WebCore:

The spec is quite clear
(https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
  "min-content
     If specified for the inline axis, use the min-content inline size;
     otherwise behaves as the property‚Äôs initial value."

So if a grid container has "height: min-content" it should behave
the same than with "height: auto".

The patch removes computeIntrinsicLogicalContentHeightUsing() in
RenderGrid as we don't need a custom one anymore.
We can also get rid of m_minContentHeight and m_maxContentHeight
attributes that were only used for this logic.

Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
      fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
      imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
* rendering/RenderGrid.h:

LayoutTests:

Update tests results to the new behavior.
Also modified a little bit the test to keep them in sync with Blink versions.

* fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows-expected.txt:
* fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html:
* fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows-expected.txt
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
LayoutTests/fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h