Re: [css3-flexbox] ambiguity in flex shorthand?

On 03/21/2013 09:47 AM, Tab Atkins Jr. wrote:
> On Thu, Mar 21, 2013 at 9:22 AM, Daniel Glazman
> <daniel.glazman@disruptive-innovations.com> wrote:
>> Can I ask why we just can't forbid
>> unitless lengths here and make the whole thing simpler?
> 
> Because there's no reason to, shrug.  Any time you write a 0 flex
> basis in the shorthand, you can instead just omit it.

Note also that forbidding unitless 0 makes implementations (slightly)
more complicated -- not simpler.

Right now, if we've parsed two numeric components in a "flex" shorthand,
then we know that the third component (if there is one) must be a
length, and we can just proceed with parsing it as a length, using
existing CSS length-parsing-code.

However, if we have to explicitly reject unitless 0, then that imposes
an additional check that we have to perform on this third component.
("OK it's a valid length! But wait -- was it unitless 0? Darn, we have
to reject it".)

~Daniel

Received on Thursday, 21 March 2013 20:57:24 UTC