W3C home > Mailing lists > Public > public-css-testsuite@w3.org > October 2010

Re: font-051/052/053/054/055/056 invalid (system font keywords are ok font families)

From: L. David Baron <dbaron@dbaron.org>
Date: Fri, 15 Oct 2010 14:34:36 -0700
To: Arron Eicholz <Arron.Eicholz@microsoft.com>, "Gérard Talbot" <css21testsuite@gtalbot.org>
Cc: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Message-ID: <20101015213436.GA8173@pickering.dbaron.org>
On Friday 2010-10-15 21:12 +0000, Arron Eicholz wrote:
> According to section 15.8  of the CSS 2.1 spec it clearly
> identifies that the values for 'caption', 'icon', 'menu',
> 'message-box', 'small-caption' and 'status-bar' cannot be mixed
> with any other font values in the font shorthand. The shorthand
> clearly identifies this restriction by using a single bar '|'
> meaning 'or' and all the individual font properties are grouped by
> the [ ]. This would mean 'font: 32pt caption' is not valid and
> must be ignored.

No, that's not what it means.

It's just repeating what's already specified in the syntax, which is
that you can have either the syntax:

    [ <'font-style'> || <'font-variant'> || <'font-weight'> ]?
    <'font-size'> [ / <'line-height'> ]? <'font-family'>

or you can have one of the system font keywords.

However, 'caption' is a perfectly valid value of <'font-family'>, so
'32pt caption' matches the complex production given.

> The cases are valid cases and no change needs to be made to the
> cases from what I can see.

They are not valid.

On Friday 2010-10-15 14:16 -0700, "Gérard Talbot" wrote:
> Please verify again the spec.
> 
> "
> Value:  	[ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]?
> <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon
> | menu | message-box | small-caption | status-bar | inherit
> "
> http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
> 
> 
> "A bar (|) separates two or more alternatives: exactly one of them must
> occur."
> http://www.w3.org/TR/CSS21/about.html#property-defs

Exactly.

But the alternative being used in this case is the first
alternative,

    [ <'font-style'> || <'font-variant'> || <'font-weight'> ]?
    <'font-size'> [ / <'line-height'> ]? <'font-family'>

The value given contains a <'font-size'> and a <'font-family'>.


On Friday 2010-10-15 14:26 -0700, "Gérard Talbot" wrote:
> "
> System fonts may only be set as a whole; that is, the font family, size,
> weight, style, etc. are all set at the same time. These values may then
> be altered individually if desired.
> "

The test is not specifying a system font.  It's specifying a
font-family for a font named 'caption'.

> So, font: 32px caption;
> is wrong and invalid. The parsing system would not know which font size
> to use: 8px (usually the default font size for caption) or 32px.

The font-size for the caption system font isn't relevant, because
this isn't specifying a system font.  It's specifying a font-family
called 'caption'.

> >   font: initial;
> >   font-size: 32px;
> >   font-family: caption;
> 
> No it's not.

Yes, see above.

> > and is perfectly valid.  The 'caption' in this case is NOT a system
> > font keyword, but it's perfectly legal.
> 
> To be a valid font-family and not a system font keyword, caption would
> have to be quoted and should be quoted to indicate that it is not the
> system font. There is a gap, a flaw in the spec wrt this.

If you think it should have to be quoted, you're welcome to raise an
issue with the spec, but the spec is consistent as it is today.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Friday, 15 October 2010 21:35:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 15 October 2010 21:35:16 GMT