Inconsistent treatment of "em" and "ex" unit when used to specify "font-size"

Intrigued by the bug report from Ryan Foster [2], I read
the CSS 3 spec. on units, and read -- to my surprise -- the
following :

em     the font size of the element (or,
        to the parent element's font size
        if set on the 'font-size' property)

ex     the x-height of the element's font

Is there any reason why "ex" does not also reference
the parent element's font size if set on the 'font-size'
property, as if "ex" units are used to specify font-size,
there would appear to be a problem of self-reference
(see example below).

Example :

         <! -- No explicit font so far -->
             <SPAN style="font-size: 0.5em">ABCDabcd</SPAN>
             <SPAN style="font-size: 1.0ex">ABCDabcd</SPAN>

The style declaration for the second span is would
appear to be self-referential, since "the font's x-height" [1]
cannot be known until the font-size has been computed ...

** Phil.
[1] The 'ex' unit is defined by the font's x-height.
     The x-height is so called because it is often equal
     to the height of the lowercase "x". However, an 'ex'
     is defined even for fonts that don't contain an "x".
     Should we say that ex is 0.5em if no better value exists?
[2] Ryan Foster wrote:

 > When set to CSS3, the CSS Validator states:
 >     Value Error : min-width
 >     <>
 >     Unknown dimension 15ch
 > While the CSS3 Values and Units <> draft specification states <>:
 >     ch:  The width of the "0" (ZERO, U+0030) glyph found in the font for
 >     the font size used to render. If the "0" glyph is not found in the
 >     font, the average character width may be used. How is the "average
 >     character width" found?
 > The Validator should mark "ch" as a valid unit when set to CSS3.  The same error occurs in the development version (

Received on Monday, 26 October 2009 17:00:44 UTC