[css-grid] Fix behavior of flexible track breadths
https://bugs.webkit.org/show_bug.cgi?id=157834
Reviewed by Sergio Villar Senin.
This patch is fixing 2 issues that are interrelated:
Source/WebCore:
1) Flex sizes are invalid as min track sizing function.
The syntax has been recently updated on the spec:
<track-size> =
<track-breadth> |
minmax( <inflexible-breadth> , <track-breadth> )
2) Flex sizes outside minmax() behave as auto minimum.
Flex sizes outside minmax() were previously behaving like
minimum and maximum (e.g. 1fr => minmax(1fr, 1fr)).
However the spec changed and now this would be invalid,
so they should behave like auto minimum (e.g. minmax(auto, 1fr)).
(WebCore::CSSParser::parseGridTrackSize): Call parseGridBreadth()
for min sizing function using "InflexibleSizeOnly" restriction
when needed.
(WebCore::CSSParser::parseGridBreadth): Add check for
"InflexibleSizeOnly" resctriction.
- css/CSSParser.h: Add new type of restriction "InflexibleSizeOnly".
- rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridTrackSize): Add new condition to make
|minTrackBreadth| auto if it was a flex size.
LayoutTests:
1) Flex sizes are invalid as min track sizing function.
2) Flex sizes outside minmax() behave as auto minimum.
The patch includes new test cases checking specifically these 2 issues.
In addition several tests results have been updated to reflect
the new behavior. Also, some cases that are now invalid and
were not testing anything new have been removed.
- fast/css-grid-layout/flex-and-content-sized-resolution-columns-expected.txt:
- fast/css-grid-layout/flex-and-content-sized-resolution-columns.html:
- fast/css-grid-layout/flex-content-resolution-columns-expected.txt:
- fast/css-grid-layout/flex-content-resolution-columns.html:
- fast/css-grid-layout/flex-content-resolution-rows-expected.txt:
- fast/css-grid-layout/flex-content-resolution-rows.html:
- fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
- fast/css-grid-layout/grid-gutters-and-flex-content-expected.txt:
- fast/css-grid-layout/grid-gutters-and-flex-content.html:
- fast/css-grid-layout/grid-preferred-logical-widths.html:
- fast/css-grid-layout/non-grid-columns-rows-get-set-expected.txt:
- fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
- fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js: