This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 942 - Incorrect / inconsistent parsing of 'font' property
Summary: Incorrect / inconsistent parsing of 'font' property
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 2.0 (show other bugs)
Version: CSS Validator
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL: http://www.employees.org/~lanzo/css/v...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-15 22:58 UTC by Mark Lanzo
Modified: 2005-08-26 14:29 UTC (History)
0 users

See Also:


Attachments

Description Mark Lanzo 2004-11-15 22:58:40 UTC
The validator reports a warning "font-family: You are encouraged to offer a
generic family as a last alternative" despite the fact that you have used a
generic family in every font specification.

As a test, I ran the validator across a document whose *entire* CSS content
consisted solely of:

<style type="text/css">
  body          { font: 10pt Helvetica, sans-serif normal; }
</style>

Even this produces the warning.

Note:  this matches bug 818, which for some reason was closed as "invalid" even
though it is apparently quite valid and easy to reproduce.
Comment 1 Olivier Thereaux 2004-11-15 23:25:35 UTC
As far as I can tell from http://www.w3.org/TR/CSS21/fonts.html#font-shorthand the "font" shorthand 
does not allow to use the variant after the font-family. 

Hence 
font: 10pt Helvetica, sans-serif normal;
is being parsed as if "sans-serif normal" were a font-family, which is *not* a generic family. 
Comment 2 Mark Lanzo 2004-11-16 15:38:22 UTC
Reason for closing bug are invalid.

Tried to send details, but the email reply address is not working.  Please
supply valid email address so I can pass that info along.
Comment 3 Olivier Thereaux 2004-11-16 18:17:35 UTC
Re: Comment #2: if it's not possible to follow-up on this bug directly on the bug tracking system (which 
would be preferred, for consistency), an alternative is the (public) mailinglist for the CSS validator - 
www-validator-css@w3.org

Comment 4 Bj 2004-11-17 12:12:47 UTC
FWIW, I agree with Olivier.
Comment 5 Olivier Thereaux 2004-11-17 12:21:17 UTC
Initial reporter Mark sent me other examples... While the generic font-family parsing issue is not 
altogether clear, it appears that the parsing of the font shorthand property is sometimes wrong, and 
often inconsistent. 

I am changing the title of this bug from:
Warns to use generic font-family despite having done so
to 
incorrect / inconsistent parsing of 'font' property
and raising priority/severity accordingly.

For reports specifically related to the font-family property, its parsing and the warning about generic 
font-family, we still have bug #818.

Mark, could you send your examples here, or is it OK if I do it?
Comment 6 Bj 2004-11-17 12:40:25 UTC
FWIW, I think 'font' parsing is known to be broken...
Comment 7 Yves Lafon 2005-08-26 14:29:39 UTC
Fixed, see http://qa-dev.w3.org:8001/css-validator/