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: Tue, 18 May 2004 21:36:06 -0500
Message-ID: <40AAC816.9050506@mit.edu>
To: ernestcline@mindspring.com
Cc: www-style@w3.org

Ernest Cline wrote:
> The problem is with the grammar as given in CSS 2.1, it looks
> like when the 'font' rule includes the slash to separate <font-size>
> and <line-height> that the result is something which going strictly by
> the tokenizer isn't tokenizable

http://www.w3.org/TR/CSS21/grammar.html#q1 has:

operator
   : '/' S* | COMMA S* | /* empty */

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

expr
   : term [ operator term ]*

declaration
   : property ':' S* expr prio?
   | /* empty */

So "10px /20px Times, Helvetica" would be tokenized as:

term(LENGTH): 10px
operator: /
term(LENGTH): 20px
operator:
term(IDENT): Times
operator: COMMA
term(ident) Helvetica

as far as I can see.

The question is what to do with that token stream afterwards.

-Boris
Received on Tuesday, 18 May 2004 22:36:23 GMT

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