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

calc() expressions, defined in
http://dev.w3.org/csswg/css3-values/#the-calc-min-and-max-functions , 
do not allow unitless zero to be treated as a length, since the spec
  # The context of the expression imposes a target type, which is
  # one of length, frequency, angle, time, or number. NUMBER tokens
  # are of type number. DIMENSION tokens have types of their units
  # (‘cm’ is length, ‘deg’ is angle etc.); any DIMENSION whose type
  # does not match the target type is not allowed and must be a
  # parse error.

I think this is a good thing; the only use cases for zero lengths
that I can think of are for the output of tools that might be
generating nonzero lengths, and in such cases the tool would
presumably be generating the unit anyway.

However, since this isn't explicitly stated, and it might trip up
authors or implementors, I think it would be good to add a note
(near the text above) that this means that '0' is never a dimension
inside calc(), even though it is allowed to be a length outside of a
calc() expression.


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Wednesday, 29 December 2010 17:42:31 UTC