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

Re: [css21] 'font-family' should disallow 'inherit' in font names more strictly

From: Gérard Talbot <www-style@gtalbot.org>
Date: Tue, 24 Apr 2012 12:23:44 -0400
Message-ID: <9bb6521e7e26cfabcab3e5c63275ceef.squirrel@ed-sh-cp3.entirelydigital.com>
To: "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>
Cc: "John Daggett" <jdaggett@mozilla.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, "WWW Style" <www-style@w3.org>

Le Mar 24 avril 2012 5:30, Kang-Hao (Kenny) Lu a écrit :
> (12/04/24 14:02), John Daggett wrote:
>> Tab Atkins Jr. wrote:


>>>> The keywords 'initial' and 'default' are reserved for
>>>> future use and must also be quoted when used _in_
>>>> font names.
>> This is equally imprecise, it implies that only the keywords are
>> quoted when what you mean to say is that font family names
>> *containing* these keywords must be quoted.
> Either that or
>   | unquoted global keywords ('inherit', 'initial' and 'default') are
>   | not allowed inside <family-name>.

div {font-family: inherit;}

is allowed, is valid, is permitted and is tested:


> I mentioned that I don't like this direction so my propose wording is
>   | If the value of 'font-family' is a single global keyword
>   | ('inherit', 'initial' and 'default'), UAs must not interpret it as
>   | <family-name> but the meaning of the global keyword.

... unless it is quoted:

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 implication is that 'font-family: foo, inherit' is still valid. This
> follows IE9.

div#a {font-family: foo, inherit;} /*  is invalid */

div#b {font-family: inherit, bar;} /* is invalid */

The CSS validator also reports these as errors:

1 	div#a 	Value Error : font-family Too many values or values are not
recognized : foo,inherit
3 	div#b 	Value Error : font-family Too many values or values are not
recognized : inherit,bar

Value:  	[[ <family-name> | <generic-family> ] [, <family-name>|
<generic-family>]* ] | inherit

A bar (|) separates two or more alternatives: exactly one of them must occur.
Brackets ([ ]) are for grouping.
An asterisk (*) indicates that the preceding type, word, or group occurs
zero or more times.

CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Tuesday, 24 April 2012 16:24:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:35:08 UTC