W3C home > Mailing lists > Public > www-style@w3.org > February 2014

[css-grid] Initial review of the rewritten layout algorithm

From: Simon Sapin <simon.sapin@exyr.org>
Date: Fri, 28 Feb 2014 12:35:42 +0000
Message-ID: <5310829E.4010307@exyr.org>
To: www-style@w3.org

Here are some random comments and questions based on reading 

I know this is a work in progress, but hopefully this feedback can still 
be helpful. Questions are meant not to be answered here but as things to 
clarify in the spec.

> Each track has a minimum and a maximum sizing function (which may be
> the same).

Please explain (with appropriate cross-referenced links) in the 
definition of grid-template-columns and grid-template-rows how these are 
determined. For example, "When a <track-size> is a single 
<track-breadth>, it specifies identical minimum and maximum sizing 
functions." and "The two arguments of a minmax() function specify the 
minimum and maximum sizing functions, respectively."

> A fixed size (<length> or resolved <percentage>).

How are percentages resolved? The refer to the size of the grid 
container, but is that determined by the time we run this algorithm? 

> 11.1 Initialize Minimum and Maximum Track Sizes
> For fixed track sizes, use that resolved size.
> [...]

What are the different things being manipulated here? Reading between 
the lines, I’m guessing that each track has:

* A pair (min and max) of sizing functions which are constant inputs to 
this algorithm. Each of these is a fixed size, intrinsic size, or a 
flexible size.
* A pair (also min and max) of "track sizes" (which perhaps deserve a 
more specific name) that are initialized here and modified several times 
in the rest of the algorithm. Each of these is a (potentially infinite) 

In other words, please define explicitly the "data structures" used in 
the algorithm.

> Set any 'min-content' track size to the maximum of their min-size
> contributions.

This (and several other places in the algorithm) seems to confuse a 
sizing function that can be 'min-content', and the corresponding "track 
size" being set which is a length.

> Subtract the corresponding (non-infinite) sizes of all spanned tracks
> from its size contribution to find the item’s remaining size
> contribution. This is the space to distribute.
> extra-space = size-contribution - ∑track-sizes

Are the "corresponding sizes" those of all spanned tracks, or only these 
with the intrinsic sizing function (min-content or max-content) relevant 
to this run of the "distribute extra space" sub-algorithm?

> Distribute the space evenly to the tracked increase of each spanned
> track with an affected size, dropping maxed-out tracks as they hit
> their maximums.
> track-size-increase = max(track-size-increase, share-of-extra-space)

What does "maxed-out track" mean? Is it something like "track size + 
planned increase > fixed size sizing function" ?

What does "dropping maxed-out tracks as they hit their maximums" mean?

How exactly is share-of-extra-space determined? Is it always extra-space 
divided number of "corresponding sizes", or is it affected by "maxed-out 

> If space remains after all tracks max out, continue to increase…
> for min-content minimum sizes, any affected tracks that happen to
> also have intrinsic maximum sizes; else all affected tracks.
> for max-content minimum sizes, any affected tracks that happen to
> also have max-content maximum sizes; else all affected tracks.
> for intrinsic maximum sizes, all affected tracks

I don’t understand what any of this means, sorry.

Simon Sapin
Received on Friday, 28 February 2014 12:36:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:40 UTC