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

Bert Bos wrote:

> > On the telcon a few weeks ago there was a discussion about
> > situations like these:
> >
> >  font-family: foo, inherit;
> >
> > I don't actually see how the present wording explictly makes
> > 'inherit, foo' invalid but not 'foo, inherit'.  Specifically, I'm
> > not sure I see an implicit priority in the grammar productions
> > that distinguish 'foo, inherit' from 'inherit, foo'.
> 
> I agree, there is no ambiguity in the current wording. 'font-family:
> inherit' is the keyword inherit; and 'font-family: foo, inherit,
> bar' is invalid, because the font name "inherit" must be quoted.
> 
> But even if it is unambiguous, it is apparently not clear. Otherwise
> different implementers wouldn't have implemented it differently.

To be clear, I think the present syntax is ambiguous because it
doesn't provide clear details on the priority of the implied
productions within the grammar.  My point above was simply that if
'inherit, foo' is invalid than 'foo, inherit' should also be invalid.
Specifically, user agents always need to prioritize matching ident+
first, then the 'inherit' keyword.  This is different from other
syntax involving identifiers where keywords are matched with higher
priority.  In this case, the keywords 'inherit', 'default' and
'initial' need to explicitly not match <font-family> to be able to
infer this priority.

> > 1. Correct the syntax to fix the placement of the comma:
> >
> > Existing:
> >   font-family: [[<family-name> | <generic-family>] [, <family-name>| <generic-family>]* ] | inherit
> >
> > Proposed:
> >   font-family: [[<family-name> | <generic-family>] [, [<family-name>| <generic-family>]]* ] | inherit
> 
> Interesting that nobody found that error before. It was correct in
> the first REC. The error was introduced in the first WD of the
> revised edition, in 2002...

Actually, Øyvind from Opera pointed this out during the F2F [1].

Regards,

John

[1] http://lists.w3.org/Archives/Public/www-style/2012May/0414.html

Received on Tuesday, 22 May 2012 01:25:01 UTC