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

Re: [css2.1][css3-fonts] keywords in unquoted font family names

From: Anton Prowse <prowse@moonhenge.net>
Date: Sun, 27 May 2012 12:18:30 +0200
Message-ID: <4FC1FF76.6020503@moonhenge.net>
To: www-style list <www-style@w3.org>
CC: John Daggett <jdaggett@mozilla.com>
On 23/05/2012 18:47, John Daggett wrote:
>
> On the CSS WG call, the group resolved to accept the proposal to add
> two changes to the CSS 2.1 errata related to the issue of reserved
> keywords in unquoted font family names.  The original proposals were
> outlined here:
>
>    http://lists.w3.org/Archives/Public/www-style/2012May/0630.html
>
> We resolved on the changes but there were some requests to adjust the
> wording of proposal 2, the tweak to the last paragraph of section 15.3
> [1]. Based on the suggested adjustments, here's what I would propose
> for the wording:
>
> Existing:
>    Font family names that happen to be the same as a keyword value
>    ('inherit', 'serif', 'sans-serif', 'monospace', 'fantasy', and
>    'cursive') must be quoted to prevent confusion with the keywords
>    with the same names. The keywords 'initial' and 'default' are
>    reserved for future use and must also be quoted when used as font
>    names. UAs must not consider these keywords as matching the
>    '<family-name>' type.
>
> Proposed:
>    Unquoted font family names that happen to be the same as the keyword
>    values 'inherit', 'default' and 'initial' or the generic font
>    keywords ('serif', 'sans-serif', 'monospace', 'fantasy', and
>    'cursive') do not match the '<family-name>' type. These names must
>    be quoted to prevent confusion with the keywords with the same
>    names. Note that 'font-family: Times, inherit' is therefore an
>    invalid declaration, because 'inherit' in that position can neither
>    be a valid keyword nor a valid font family name.

> [1] http://www.w3.org/TR/CSS21/fonts.html#font-family-prop

I like the normative first sentence, but I think the second sentence 
should be bundled up with the non-normative note.  This would alleviate 
my concern that it's not clear from the tone whether 'must' is an 
authoring recommendation or a conformance requirement; does not quoting 
result in an invalid value or merely "confusion"? (In reality, whether 
or not it's invalid depends entirely on the value definition and the 
global grammar/syntax etc, which is captured succinctly by the normative 
first sentence.)

I also think the last sentence (the example) doesn't tie in correctly 
with the the first sentence, since it's not the /position/ of 'inherit' 
that causes it not the be a valid font family name; rather, it's the 
fact that it isn't quoted.

I suggest:

   | Unquoted font family names that happen to be the same as the keyword
   | values 'inherit', 'default' and 'initial' or the generic font
   | keywords ('serif', 'sans-serif', 'monospace', 'fantasy', and
   | 'cursive') do not match the '<family-name>' type.
   |
   | Note: These names must be quoted to distinguish them from the
   | keywords with the same names.  For example, the declaration
   | 'font-family: Times, inherit' is invalid because 'inherit' is
   | interpreted as the keyword, resulting in an invalid value.


Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Sunday, 27 May 2012 10:18:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT