Bug Report: CSS3 Validation of "ch" unit

View: New views
3 Messages — Rating Filter:   Alert me  

Bug Report: CSS3 Validation of "ch" unit

by Ryan Foster-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 (http://qa-dev.w3.org:8001/css-validator/).

Re: Bug Report: CSS3 Validation of "ch" unit

by Philip TAYLOR (Ret'd) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Intrigued by the following bug report from Ryan Foster, 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 ?

Philip TAYLOR
--------
Ryan Foster wrote:

> When set to CSS3, the CSS Validator states:
>
>     Value Error : min-width
>     <http://jigsaw.w3.org/css-validator/nullvisudet.html#propdef-min-width>
>     Unknown dimension 15ch
>
> While the CSS3 Values and Units <http://www.w3.org/TR/css3-values/>
> draft specification states <http://www.w3.org/TR/css3-values/#relative0>:
>
>     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
> (http://qa-dev.w3.org:8001/css-validator/).


Re: Bug Report: CSS3 Validation of "ch" unit

by David Dorward-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 26 Oct 2009, at 10:54, Philip TAYLOR wrote:
> 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 ?


Presumably because the size of the em depends only on the font-size  
wile the ex depends on the combination of the font-size and the font-
family (which is covered by the font shorthand property).

--
David Dorward
http://dorward.me.uk