Re: [csswg-drafts] [css-grid] Applying 'justify-content' content distribution is in the wrong place in the overall grid sizing algo

Doing the distribution step immediately after the track sizes are known always leads to better results as far as I can tell.  You need both the _position_ and size of the columns to calculate the correct CB inline-size for column-spanning items, and the CB inline-size is required to determine any content-based block-axis contributions for the items. I don't think the proposed change makes any difference to how row sizes are estimated for orthogonal items, since that happens during (or before) step 1.

(I tend to think that the row estimation is suboptimal/wrong in both Chrome and Firefox currently though and that we can improve the heuristic there, but that seems like a separate issue.)

>Perhaps this is an implementation detail, but we only run step 1 of the algorithm in order to determine the preferred width. Once set, we use this preferred width during the layout, so we can't then change it if Step 3 gives a different result for the columns.

That's basically what Gecko does too.  The proposed change doesn't affect that in any way though, since distribution of space only happens when the grid container has a definite size in that axis (so it doesn't occur during intrinsic sizing).

-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2557#issuecomment-391184852 using your GitHub account

Received on Wednesday, 23 May 2018 00:43:22 UTC