W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: [css2.1] [css3-fonts] <family-name> ambiguous - partially quoted names allowed?

From: Bert Bos <bert@w3.org>
Date: Wed, 22 Apr 2009 15:43:14 +0200
To: W3C Emailing list for WWW Style <www-style@w3.org>
Message-Id: <200904221543.14754.bert@w3.org>
On Tuesday 21 April 2009, Zack Weinberg wrote:
> Mozilla has a bug report[1] requesting that this:
>
>   font-family: "lucida" grande;
>
> be treated as equivalent to this:
>
>   font-family: lucida grande;
>
> There is no formal grammar for <family-name> and the prose does not
> say whether some-but-not-all tokens of a family-name can be quoted. 
> Matter of fact, it doesn't really explain what the grammar is at all
> - it just says that certain punctuation characters must be \-escaped
> if they appear unquoted in a family-name.
>
> My preferred reading of the spec would disallow partial quotation,
> but what I really care about as an implementor is that there be an
> unambiguous, ideally formal, grammar for every nonterminal.

Partially quoted names were not among the original use cases. Maybe it's 
possible to read the spec as syntactically allowing them, but it 
certainly doesn't define what they mean.

The intent can, I think, be captured by this annotated grammar:

  Value: [ [ <family-name> | <generic-family> ] [ , <family-name> |
    <generic-family> ]* ] | inherit;
  <generic-family>: serif | sans-serif | cursive | fantasy | monospace;
  <family-name>: STRING | IDENT+;  /* see restriction below */

where the restriction is that <family-name> cannot be one of the single 
IDENTs serif, sans-serif, cursive, fantasy, monospace, inherit, default 
or initial.

(The spec is not worded very well with respect to 'default' 
and 'initial', implying that it is somehow obvious that they are 
reserved, although it is only obvious if you've read CSS3 Values And 
Units...)

>
> zw
>
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=481502 (note that
> the initial discussion is about font: rather than font-family:, but
> the requested change would affect both, and is easier to explain in
> terms of the longhand notation).



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 22 April 2009 13:43:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT