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

Re: [CSS21] Font-family syntax

From: Etan Wexler <ewexler@stickdog.com>
Date: Fri, 20 Aug 2004 21:03:52 -0700
To: www-style@w3.org
Message-Id: <1D10DC37-F327-11D8-94CF-000502CB1B77@stickdog.com>

Bert, I thank you for responding. I hope that your response is an 
indication that the Working Group is studying the issue at hand.

Bert Bos wrote to <mailto:www-style@w3.org> on 20 August 2004 in "Re: 
[CSS21] Font-family syntax" 
(<mid:16678.20219.160012.538488@lanalana.inria.fr>):

> I think there is no parsing error: the parentheses are balanced and 
> there
> are no forbidden characters. I'm not a machine, but I think the tokens
> are (omitting the whitespace tokens for brevity):
>
>     IDENT  ->  Trouble
>     DELIM  ->  :
>     IDENT  ->  A
>     (      ->  (
>     IDENT  ->  Very
>     )      ->  )
>     IDENT  ->  Troublesome
>     IDENT  ->  Type
>     IDENT  ->  Family
>     DELIM  ->  &
>     IDENT  ->  Interesting
>     IDENT  ->  Prospect
>     DELIM  ->  .
>
> It matches the general syntax for declarations and nothing in the
> 'font-family' definition forbids any of these tokens, as far as I
> know.

But Appendix G, section, which declares itself normative, gives the 
following productions. The productions forbid the appearance of the 
colon, parentheses, ampersand, and period. Generate a parser from the 
productions and let's run tests, if that is needed to prove the point. 
If there is anything else that I can do to explain or demonstrate the 
issue, please let me know.

operator
   : '/' S* | COMMA S* | /* empty */
   ;
unary_operator
   : '-' | PLUS
   ;
property
   : IDENT S*
   ;
declaration
   : property ':' S* expr prio?
   | /* empty */
   ;
prio
   : IMPORTANT_SYM S*
   ;
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
   ;
function
   : FUNCTION S* expr ')' S*
   ;
/*
  * There is a constraint on the color that it must
  * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
  * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
  */
hexcolor
   : HASH S*
   ;

-- 
Etan Wexler.
Received on Saturday, 21 August 2004 04:06:08 GMT

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