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 Mon, Aug 19, 2013 at 11:28 PM, Daniel Holbert <dholbert@mozilla.com> wrote:
> Hi www-style,
>
> Question: Should "align-self: stretch" on a flex item (stretching it in
> the cross axis) be able to have any effect on a flex item's main size?
> (in the absence of any intrinsic-ratio effects)
>
> >From my reading, the answer from the current flexbox ED is "no" -- the
> spec's algorithm *first* establishes the main size of flex items and of
> the flex container (in section 9.2 through 9.3), and it only takes
> "align-self:stretch" into account when we're midway through section 9.4.
>  But Chrome and Opera don't seem to match my expectations, and I like
> their behavior & think we might want to amend the spec to explicitly
> call for their behavior.
>
> Consider this testcase:
> http://people.mozilla.org/~dholbert/tests/flexbox/can-stretch-affect-main-size-1.html
>
> That testcase contains two examples, which only differ in their
> "align-items" value on the outermost (vertical) container.
>
> In Chrome & Opera, the first example (the one with "stretch") has a
> reduced height (main-size) with respect to the second example (the one
> with flex-end.)
>
> I think this is incorrect, per spec (as noted in my 2nd paragraph
> above). However, I think the behavior makes sense; if we know up-front
> that we're eventually going to be stretching a vertical flex item's
> width, and we can compute what its stretched width will be, and we have
> to do a trial layout to establish a hypothetical height, then I think it
> makes the most sense to do that trial layout *using the stretched
> width*.  I'm guessing that's what Chrome and Opera are effectively
> doing, though I'm not sure.

As far as fantasai and I can tell, the Chrome/Opera behavior is
currently mandated by the spec.  On the other hand, it's 1am right
now.  So, would you mind walking through the algorithm, as you believe
it should be run, and let us know why you think the Firefox behavior
is correct?

~TJ

Received on Wednesday, 11 September 2013 23:08:12 UTC