Re: [css3-flexbox] Behavior of flex() in non-flex situations

On Fri, Sep 16, 2011 at 11:17 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> How should we treat an element using flex() in its 'width' or 'height'
> when it's not a flexbox item?  The most obvious answer (to make it a
> syntax error) isn't available to us, because we don't know whether
> it's invalid or not until computed value time.
>
> I see two reasonable answers:
>
> 1. It computes to 'auto'.
> 2. It computes to the preferred length in the function.
>
> I prefer #2.  It seems to stay closer to the author's intent - if they
> wrote "width: flex(1 200px);" for a flexbox item, they're saying the
> item should start at 200px, and then flex larger if there's free
> space.  If you're in a context that can't flex, there's no free space,
> so it should just stay at 200px.
>
> I'd like to require authors not to use flex() outside of flexbox
> items, but define the UA handling as #2.
>
> Thoughts?
>

I prefer 2 as well. It's what WebKit's implementation does currently as that
was the most natural way to implement it.

Ojan

Received on Friday, 16 September 2011 18:27:14 UTC