W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: Question on parsing of "font" property

From: Justin Wood <jw6057@bacon.qcc.mass.edu>
Date: Tue, 18 May 2004 21:44:54 -0400
Message-ID: <40AABC16.4060509@bacon.qcc.mass.edu>
To: Boris Zbarsky <bzbarsky@MIT.EDU>, www-style@w3.org

Boris Zbarsky wrote:

>
> I was asked what the right parsing of the following CSS is:
>
>   font: 10px /2 Times;
>
> (note the space before the '/'), and it seems to me that this could be 
> parsed as either:
>
>   font-size: 10px;
>   font-family: /2 Times;
>
> or
>
>   font-size: 10px;
>   line-height: 2;
>   font-family: Times;
>
> Both look to be valid, no?
>
> -Boris
>
>
well neither are valid, if I recall correctly, since line-height needs a 
qualifying <length> value which the literal 2 is not, and if I also 
recall correctly any non-alpha-numeric value in font-family would make 
the whole family be quoted.

::goes to double check CSS 2.1 to make sure he is not spouting incorrect 
material::

ick, I was incorrect...

Well taking into account the exact syntax in the spec:

/Value:/  [ [ <'font-style'> 
<http://www.w3.org/TR/CSS21/fonts.html#propdef-font-style> || 
<'font-variant'> 
<http://www.w3.org/TR/CSS21/fonts.html#propdef-font-variant> || 
<'font-weight'> 
<http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight> ]? 
<'font-size'> <http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size> 
[ / <'line-height'> 
<http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height> ]? 
<'font-family'> 
<http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family> ] | caption 
| icon | menu | message-box | small-caption | status-bar | inherit 
<http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit>

BZ's comments should be addressed in both the spec and here
Received on Tuesday, 18 May 2004 21:46:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:30 GMT