[css3-values] calc(), whitespace, and DIMENSION tokens

The spec for calc() currently doesn't talk about whitespace at all. Perhaps
it's implied somewhere else, but I'm not familiar enough with the grammar to
know where.

I'll note that
   3cm-2cm
will be parsed as a single DIMENSION token and
   3cm -2cm
will be parsed as two DIMENSION tokens. Is that what we want? Is whitespace
required around minus and plus signs to treat them like operators or is
tokenization different inside calc() like it is inside :nth-child()?

I think it's fine to require white space around plus and minus signs in
calc() expressions, since that helps emphasize that they're lower precedence
than * and /. However, if we're requiring white space around these operators
in calc(), then we should at least allow white space around them in :nth-child().

http://www.w3.org/TR/CSS21/syndata.html#tokenization

~fantasai

Received on Tuesday, 11 March 2008 22:41:49 UTC