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

[CSS21] Font-family syntax

From: Etan Wexler <ewexler@stickdog.com>
Date: Fri, 6 Aug 2004 02:10:31 -0700
To: www-style@w3.org
Message-Id: <77D1A60E-E788-11D8-AD43-000502CB1B77@stickdog.com>

Boris Zbarsky wrote to <mailto:www-style@w3.org> on 19 May 2004 in 'Re: 
Question on parsing of "font" property' 
(<mid:40AC125D.2000308@mit.edu>):

> [...] 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.

[...]

> I do agree that per the grammar '@' would indeed need to be escaped.

There are many syntactic constructs which, though allowed by the prose 
description of 'font-family', are forbidden by the Appendix G grammar 
[GRAM]. As noted, the bare commercial at sign (U+0040) is one. It 
becomes necessary to move to a value syntax like that in section 4, the 
core syntax  [SD]:

value       : [ any | block | ATKEYWORD S* ]+;
any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
               | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
               | DASHMATCH | FUNCTION S* any* ')'
               | '(' S* any* ')' | '[' S* any* ']' ] S*;


Even then, blocks nested in parentheses or in brackets remain illegal:

font-family: (this {is} illegal);

The remedy is simple:

value       : [ any | block | ATKEYWORD S* ]+;
any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
               | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
               | DASHMATCH | FUNCTION S* value? ')'
               | '(' S* value? ')' | '[' S* value? ']' ] S*;

Your humble correspondent has addressed this in previous messages 
[BN-1] [BN-2].



[GRAM]
Bert Bos; Tantek Çelik; Ian Hickson; Håkon Wium Lie.
"Grammar of CSS 2.1", appendix G in the CSS 2.1 specification.
25 February 2005.
W3C Candidate Recommendation.
<http://www.w3.org/TR/2004/CR-CSS21-20040225/grammar.html>

[SD]
Bert Bos; Tantek Çelik; Ian Hickson; Håkon Wium Lie.
"Tokenization", section 4.1.1 in the CSS 2.1 specification.
25 February 2005.
W3C Candidate Recommendation.
<http://www.w3.org/TR/2004/CR-CSS21-20040225/syndata.html#tokenization>

[BN-1]
Etan Wexler.
"Re: Blocks in parentheses or brackets".
14 February 2003 (but self-labeled 14 December 2003).
Public correspondence to <mailto:www-style@w3.org>.
<mid:blocks-in-parentheses@d20030214.etan.wexler> /
<http://lists.w3.org/Archives/Public/www-style/2003Feb/0054.html>.

[BN-2]
Etan Wexler.
"Re: Blocks in parentheses or brackets".
8 March 2003.
Public correspondence to <mailto:www-style@w3.org>.
<mid:BA8EE31E.3CD%25ewexler@stickdog.com> /
<http://lists.w3.org/Archives/Public/www-style/2003Mar/0055.html>.


-- 
Etan Wexler.
Received on Friday, 6 August 2004 05:24:45 GMT

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