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

Re: Question on parsing of "font" property

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 19 May 2004 21:05:17 -0500
Message-ID: <40AC125D.2000308@mit.edu>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: www-style@w3.org

Andrew Fedoniouk wrote:
>>So?  What do font names have to do with nmtoken>
> 
> Let's take a look here:
> 
> declaration
>   : property ':' S* expr prio?
> expr
>   : term [ operator term ]*
> term
>   : unary_operator?
>     [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
>       TIME S* | FREQ S* | function ]
>   | STRING S* | IDENT S* | URI S* | hexcolor
> operator
>   : '/' S* | COMMA S* | /* empty */
>   ;

Yes, agreed.

> following this we are getting rule for a non quouted font names:
> 
> font-name: IDENT S* [, IDENT S* ]* 

You made this rule up, right?  It's not in the grammar that I can see....  As 
far as I can tell from the above, we are actually getting the following rule for 
non-quoted font names:

   font-name: term [ operator term ]*

where "operator" is not allowed to be a COMMA.  But it can certainly be 
whitespace as in:

   font: 10px Times New Roman;

or it can be a '/', per that grammar and the fact that '/' is not excluded in 
the property description.

I do agree that per the grammar '@' would indeed need to be escaped.  But a '/' 
would not.

-Boris
Received on Wednesday, 19 May 2004 22:05:52 GMT

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