Bug 180283 - [css-grid] Automatic minimum size is not clamped if min track sizing function is auto
Summary: [css-grid] Automatic minimum size is not clamped if min track sizing function...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
Keywords: InRadar
Depends on: 180345
  Show dependency treegraph
Reported: 2017-12-01 14:36 PST by Javier Fernandez
Modified: 2017-12-11 23:12 PST (History)
9 users (show)

See Also:

Test case to reproduce the bug (168 bytes, text/html)
2017-12-01 14:36 PST, Javier Fernandez
no flags Details
Expected (4.11 KB, image/png)
2017-12-01 14:36 PST, Javier Fernandez
no flags Details
Patch (17.76 KB, patch)
2017-12-11 21:50 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2017-12-01 14:36:19 PST
Created attachment 328159 [details]
Test case to reproduce the bug

The spec is quite clear regarding this (https://drafts.csswg.org/css-grid/#min-size-auto):

"However, if the grid item spans only grid tracks that have a fixed max track sizing function, its specified size and content size in that dimension (and the input to the transferred size in the other dimension) are further clamped to less than or equal to the stretch fit the grid area’s size (so as to prevent the automatic minimum size from forcing overflow of its fixed-size grid area)."

It says that if the max track sizing function is fixed, it should clamp the automatic minimum size.

In the attached example we have a grid container with:
  grid-template-columns: minmax(auto, 0px);

So the automatic minimum size of the item needs to be clamped to 0px.
And the final size of the track should be 0px.

This is basically what this test wrongly checks:

Firefox does this right.
Comment 1 Javier Fernandez 2017-12-01 14:36:44 PST
Created attachment 328160 [details]
Comment 2 Manuel Rego Casasnovas 2017-12-11 21:50:01 PST
Created attachment 329088 [details]
Comment 3 WebKit Commit Bot 2017-12-11 23:11:08 PST
Comment on attachment 329088 [details]

Clearing flags on attachment: 329088

Committed r225776: <https://trac.webkit.org/changeset/225776>
Comment 4 WebKit Commit Bot 2017-12-11 23:11:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2017-12-11 23:12:37 PST