Re: [css3-flexbox] corrections/clarifications on updated flexbox algorithm

Hi Alex,

On 02/15/2012 10:40 PM, Alex Mogilevsky wrote:
> ±    (b) "using the shrink-to-fit algorithm" -- could this link to somewhere
> ± where that algorithm is definitively defined?
>
> "shrink-to-fit" should be defined here more specifically. It is the same as sizing a float or positioned element in CSS2.1 (http://www.w3.org/TR/CSS21/visudet.html#float-width), but without the last step of min(max(preferred minimum width, available width), preferred width).
>
> Any suggestions for normative text to put here?

The text you added there sounds pretty good to me, except that it 
explicitly refers to "widths", even though we're calculating "main size" 
(which could be a height).

Also, right now, it's unclear what the shrink-to-fit main size (height) 
would be when the inline axis & main axis are opposite, e.g. for a block 
of english text inside a vertical flexbox.  Would it just be the height 
of that block, when it gets its preferred width?

One other nit: that chunk in the spec now says "This module doesn't 
define the exact algorith" - missing an "m" non the end of "algorithm" 
there.

> ±    (e) Also -- each flexbox item also now has a hypothetical *cross* size,
> ± too, right?  Might as well state that here as well.  (Later on, Step 5 will
> ± tell us to "Update" the hypothetical cross sizes, without ever having
> ± established where these sizes were originally set.)
>
> No, it won't. It will have hypothetical cross size when laid out in final main size.

OK -- in that case, I think the text in step 6 "Update each item's 
hypothetical cross size" should have s/Update/Set/, since we haven't yet 
established any hypothetical cross size *until that point*. (so there's 
nothing to "update")

> ±    (i) The language "a cross axis parallel to their inline axis" makes it
> ± sound like the cross axis can differ for each flexbox-item (which it can't).
> ± It'd probably be clearer to say "an inline axis parallel to the flexbox's
> ± cross axis".  (This applies to both 7.2 and 7.3)
>
> How about
>
> 	| 2. If main axis is parallel to inline axis, collect all the flexbox
> 	| items with a 'flex-item-align' of 'baseline'.

Hm, I'm not sure about that -- can't the inline axis vary on a 
per-flexbox-item level?  (one item could contain vertical text, and the 
next might contain horizontal text)  The new language seems to imply 
it's all-or-nothing.

How about something like this:
   | 2. Collect all the flexbox items that have an inline
   | axis parallel to the flexbox's main axis and also have
   | a 'flex-item-align' of 'baseline'.

(From there on, the updated language in this chunk sounds good to me)

Thanks for the quick response / fixes!

~Daniel

Received on Friday, 17 February 2012 20:11:57 UTC