Bug 180283

Summary: [css-grid] Automatic minimum size is not clamped if min track sizing function is auto
Product: WebKit Reporter: Javier Fernandez <jfernandez>
Component: Layout and RenderingAssignee: Manuel Rego Casasnovas <rego>
Severity: Normal CC: bfulgham, commit-queue, darin, jfernandez, rego, simon.fraser, svillar, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/chromium/issues/detail?id=786971
Bug Depends on: 180345    
Bug Blocks:    
Description Flags
Test case to reproduce the bug
Patch none

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