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

Re: Question on parsing of "font" property

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 19 May 2004 20:32:55 -0700
Message-ID: <001101c43e1b$254a9360$0301a8c0@ATHLON>
To: "Boris Zbarsky" <bzbarsky@MIT.EDU>
Cc: <www-style@w3.org>

>
>    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;
>

Beg my pardon, Boris, but where did you get this *where "operator" is not
allowed to be a COMMA* ?

As far as I can see:

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

exactly COMMA is.

Whitespace is a neutral delimeter here as in any other similar syntactic
constructions.

Moreover following your font-name declaration:
font-name: term [ operator term ]*

font name MUST be either single word (IDENT) or quoted value (STRING).

Otherwise it will not go through the parser which use given grammar.

Objections, your honor? :)

Andrew Fedoniouk.
http://terrainformatica.com






>
> 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 23:33:09 GMT

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