[css3-values] Lengths and calc()

In CSS3 Values and Units sections 3.4.1. and 3.7.4. should be  
harmonised, i.e. the former should use <atomic-length> instead of  
<length> or explicitely refer to the overwrite by 'calc()'.

3.4.1 Lengths
| The format of a length value (denoted by <length>) is a <number>  
immediately followed by a
| unit identifier (e.g., 'px', 'gd').

That is:

   <length> := <number> <length-unit>

3.7.4. The 'calc' function
| The calc(<expression>) function can be used wherever length values  
are allowed.

This <expression> is replaced by <length-expression> further on.

| The expression language is defined by 'length-expression' below:
|   <length> := calc( <length-expression> ) | <atomic-length>
|   <length-expression> := <length-additive-expression>
   ...
|   <atomic-length> := <number><length-unit>

Is the limitation of 'calc()' to lengths (i.e. no percentages,  
angles, times, frequencies and probably others) intentional?

I wonder if CSS could include railroad or syntax diagrams for those  
BNF parts, like JSON.org does.

   <atomic-length> := <number> <length-unit> | <zero>
   <number>        := <integer> | <real-number>
   <integer>       := <sign> <int>
   <sign>          := <positive-sign> | <negative-sign>
   <positive-sign> := '+' | ''   % implicit
   <negative-sign> := '-'
   <int>           := <digit> | <digit> <int>   % zero-padding allowed
   <digit>         := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' |  
'8' | '9'
   <real-number>   := <integer> <float-part> | <sign> <float-part>    
% "-.5" legal
   <float-part>    := <decimal-separator> <int>
   <decimal-separator> := '.'
   <zero>          := '0'
   <non-negative-number>  := <non-negative-integer> | <non-negative- 
real>
   <non-negative-integer> := <positive-sign> <int>
   <non-negative-real>    := <non-negative-integer> <float-part> |  
<positive-sign> <float-part>
   <length-unit>   := <absolute-length-unit> | <relative-length-unit>  
| <percent>
   <absolute-length-unit> := 'mm' | 'cm' | 'pt' | 'pc' | 'in'   % all  
case-insensitive
   <relative-length-unit> := 'em' | 'ex' | 'px' | 'gd' | 'rem' | 'vw'  
| 'vh' | 'vm' | 'ch'
   <percent>       := '%'
   <angle>         := <number> <angle-unit>
   <angle-unit>    := 'deg' | 'grad' | 'rad' | 'turn'
   <time>          := <non-negative-number> <time-unit>
   <time-unit>     := 'ms' | 's'
   <frequency>     := <non-negative-number> <frequency-unit>
   <frequency-unit>:= 'Hz' | 'kHz'

Section 3.5 has "non-negative" in the title, but the definitions use  
<number> instead of <non-negative number>.

PS: How expensive is the addition of more ((absolute) length) units?  
I know the benefit is severely limited by lack of backwards  
compatibility, but for some (future) applications accuracy might be  
more important (e.g. for Didot points).

Received on Wednesday, 12 March 2008 12:12:56 UTC