Re: [css3-flexbox] Should "align-self:stretch" have any effect on main-size? (i.e. should stretched cross-size be used for establishing main size?)

On 10/30/2013 01:39 PM, Daniel Holbert wrote:
> Also, here's a simpler testcase that demonstrates this issue:
> http://people.mozilla.org/~dholbert/tests/flexbox/can-stretch-affect-main-size-2.html
> 
> (Hopefully this 2nd testcase is easier to reason about than the one I
> posted before, since it only uses a single flex container, instead of
> nested containers).

For the record, here's a brief overview of what happens when rendering
this new testcase:

So, we've got a fixed-width vertical flexbox, which has one flex item
(an inflexible auto-sized div), which itself contains a 50%-width div
with text "A A A". Everything is auto-height.

To determine the main size (height) of the flex item, we reflow it with
its preferred width, which is the preferred width of its child, which is
the width of "A A A". But unfortunately, when we (temporarily) give the
item that width, its own child has to resolve *its* 50%-width against
that, and so the "A A A" text doesn't fit and ends up wrapping to 3
lines.  So we end up with a height of ~3em for that flex item (and the
flex container).  Cool, so now we've established the main size of the
item & container: ~3em. We proceed with the rest of the flex algorithm.

Firefox, Chrome, and Opera(Presto) all agree on this result, BTW, when
we're using "align-self: flex-end" (or any other value besides "stretch").

But when we use "align-self: stretch", then Opera and Chrome end up
using a different main-size (~1 em, instead of ~3em).  That difference
doesn't make sense to me from the current spec, because the "align-self"
value isn't supposed to be taken into account until after we've already
locked in the main size.  (But I'd like to change that.)

Received on Wednesday, 30 October 2013 20:47:45 UTC