- From: Mats Palmgren <mats@mozilla.com>
- Date: Thu, 17 Dec 2015 23:37:26 +0100
- To: www-style@w3.org
On 12/10/2015 22:44, fantasai wrote: > On 12/02/2015 06:39 PM, Mats Palmgren wrote: >> https://drafts.csswg.org/css-grid/#valdef-repeat-auto-fill >> 4. How should a zero track size in the repeat() be handled? > > We've added the following paragraph for now: > > For the purpose of finding the number of auto-repeated tracks, > the UA must floor the track size to a UA-specified value > to avoid division by zero. > It is suggested that this floor be ''1px'' or less. Seems reasonable to me. The text needs to be more precise though. Does the above mean that the tracks from repeat(auto-fill, 0) is treated as having minmax(0, 1px) in the Track Sizing algorithm? (and repeat(auto-fill, minmax(0,auto)) as minmax(1px,auto) etc) Or is it restricted to finding the number of repeated tracks only and will use the non-floored track sizing function everywhere else? > This seems like a silly case (auto-repeating zero-sized tracks), > so we're thinking nothing special should be done for subcases with > grid gap (that is, still floor the track size as above). OK. >> 6. In general, "positive integer" means one or more. But it seems >> undesirable to generate a track if it causes overflow so I'm really >> not sure what you mean by that term here. > > Yes, it always generates at least one track. The auto-repeat > semantically indicates that you want to fill in some content > there, so it's likely confusing if it's possible to get > *nothing* to show up there. In the case that the window gets > too narrow, you still want at least one column to put the > content into--you don't want the auto-fill area to just > disappear. OK. The problem is that the spec is rather vague about that and can be read in different ways. With the current language, I read the "don't create overflow" as the more important criteria. Perhaps you could use "one or more tracks" or something to explicitly rule out zero tracks as an alternative (in the auto-fill section)? >> 7. When the size is indefinite, and the min size is definite but zero, >> how many tracks should be generated? for example: >> >> <div style="display: grid; >> grid-template: repeat(auto-fill,10px) / 10px; >> min-width: 0;"> > > The spec currently says > “Otherwise, if the grid container has a definite min size > in the relevant axis, the number of repetitions is the > largest possible positive integer that fulfills that > minimum requirement.” > which is actually an error, it should be s/largest/smallest/ :) > but in any case the requirement is "positive integer", so > one repetition, not zero. OK, but again: the spec language is vague. A reader really shouldn't have to guess what is meant. Zero tracks "fulfills" a zero size IMO. Again, I'd suggest using the more explicit "one or more" here, and instead of "fulfills" perhaps "such that the sum of their sizes (including grid gaps) is greater than or equal to the min size" > > ~fantasai and TJ > /Mats
Received on Thursday, 17 December 2015 22:37:58 UTC