Re: [csswg-drafts] [css-grid] Grid track sizing items spanning a flexible track

@svillar I think you're missing one of two things: 1) The space distributing algorithm maintains the planned increase separately from the track sizes subtracted out to find the space to distribute exactly so that we don't have this order dependence. 2) The step we added invokes space distribution for all items spanning flexible tracks at once (“together, rather than grouped by span size”) so that the planned increase isn't cleared out between them--i.e. items spanning flexible tracks aren't ordered by span size, as other items are.

So the processing of items will generate the following result:

1. The `50px` item folds into the planned increase -> `[0 0 50]`.
2. The `100px` item folds into the planned increase -> `[100 0 50]`.
3. The `90px` item folds into the planned increase -> `[100 0 60]`.
4. The planned increase is added to the track sizes (currently `[0 0 0]`) yielding `[100 0 60]` at the end of intrinsic track sizing.
5. If there is space available afterwards, the Expand Flexible Tracks step inflates the 60px track to match the ratios, yielding `[100 0 200]` (or as close to it as it can get given the limits of available space).

The algorithm preserves order independence. It doesn't maintain the fr ratios when there isn't space to do so, this is intentional. It isn't tightly packed always, as in this example--in order that simple cases with spanning item being the largest maintain their ratios insofar as possible in the available space.

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

Received on Monday, 30 April 2018 19:12:16 UTC