Re: [css3-values] unitless zero lengths inside 'calc()'

2010/12/29 Brad Kemper <brad.kemper@gmail.com>:
> What is the harm of having unitless zero allowed? The benefit is that authors would not need to remember a special exception to unitless zeros that can be applied everywhere else that lengths are accepted.

It's ambiguous.  What's calc(0), a number or a length?  Is calc(0 +
2em) valid?  What about calc(0 + 3)?  In calc(2em * 0 + 0), would 0 be
a number both times, or a number the first time and a length the
second?

calc() requires us to do some (very basic, in the current version)
unit algebra, and the ambiguity makes this trickier (though not
unsolvable).

~TJ

Received on Wednesday, 29 December 2010 18:48:57 UTC