From: GTalbot on
Hello fellow comp.infosystems.www.authoring.stylesheets colleagues,

Suppose this rule:

span {font: 32px caption;}

According to you, is this CSS rule valid, legal?

URL to test this:

http://www.gtalbot.org/Stylesheets/font-shorthand-system-font-validator-bug..css

Relevant spec:

Section 15.8 states:
"
'font'
Value: [ [ <'font-style'> || <'font-variant'> || <'font-
weight'> ]?
<'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption |
icon | menu
| message-box | small-caption | status-bar | inherit

(...)

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.
"
http://www.w3.org/TR/CSS21/fonts.html#font-shorthand


Section 1.4.2.1 states:
"
A bar (|) separates two or more alternatives: exactly one of them must
occur.
"
http://www.w3.org/TR/CSS21/about.html#value-defs

season's greetings,

Gérard
From: C A Upsdell on
GTalbot wrote:
> Hello fellow comp.infosystems.www.authoring.stylesheets colleagues,
>
> Suppose this rule:
>
> span {font: 32px caption;}
>
> According to you, is this CSS rule valid, legal?
>
> URL to test this:
>
> http://www.gtalbot.org/Stylesheets/font-shorthand-system-font-validator-bug.css
>
> Relevant spec:
>
> Section 15.8 states:
> "
> 'font'
> Value: [ [ <'font-style'> || <'font-variant'> || <'font-
> weight'> ]?
> <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption |
> icon | menu
> | message-box | small-caption | status-bar | inherit
>
> (...)
>
> 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.
> "
> http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
>
> Section 1.4.2.1 states:
> "
> A bar (|) separates two or more alternatives: exactly one of them must
> occur.

Could be ambiguous: a font named "caption" could exist, and how would
the parser know whether the font or the keyword is intended?

I am not a fan of sort-cut syntaxes which catenate a bunch or properties
together: this can cause a problem for old browsers; and it makes it
harder to forsee syntax errors.


From: GTalbot on
On 25 déc, 02:14, C A Upsdell <cupsd...(a)nospam.not> wrote:
> GTalbot wrote:
> > Hello fellow comp.infosystems.www.authoring.stylesheetscolleagues,
>
> > Suppose this rule:
>
> > span {font: 32px caption;}
>
> > According to you, is this CSS rule valid, legal?
>
> > URL to test this:
>
> >http://www.gtalbot.org/Stylesheets/font-shorthand-system-font-validat...
>
> > Relevant spec:
>
> > Section 15.8 states:
> > "
> > 'font'
> >     Value:      [ [ <'font-style'> || <'font-variant'> || <'font-
> > weight'> ]?
> > <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption |
> > icon | menu
> > | message-box | small-caption | status-bar | inherit
>
> > (...)
>
> > 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.
> > "
> >http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
>
> > Section 1.4.2.1 states:
> > "
> > A bar (|) separates two or more alternatives: exactly one of them must
> > occur.
>
> Could be ambiguous:  a font named "caption" could exist, and how would
> the parser know whether the font or the keyword is intended?

By quoting caption (and other system font reserved names). Just like
it is done for ...

"
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.
"
http://www.w3.org/TR/CSS21/fonts.html#font-family-prop

season's greetings, Gérard