[css-grid] Don't expand flexible tracks under a min-content constraint #3683
Labels
Closed Accepted by CSSWG Resolution
Commenter Satisfied
Commenter has indicated satisfaction with the resolution / edits.
css-grid-1
Tested
Memory aid - issue has WPT tests
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Consider this code: https://jsfiddle.net/wjthokzf/
The grid is sized under a min-content constraint. The sizing algorithm reaches https://drafts.csswg.org/css-grid/#algo-flex-tracks with a base size and growth limit of 0 for the column.
The free space is indefinite, so the used flex fraction is the result of finding the size of an fr, called with the column and the max-content contribution of the item (100px) as the space to fill. The leftover space is 100px, the flex factor sum is 1, the hypothetical fr size is 100px, and this is what the algorithm returns. So the flex fraction is 100px. And the base size of the column is set to 100px.
However, neither Chromium, Firefox nor Edge do this. The column is 0px wide.
So I think that this "Expand Flexible Tracks" step should only happen if the available space is definite, or if the grid is being sized under a max-content constraint. But not when under a min-content constraint.
The text was updated successfully, but these errors were encountered: