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 16362 - Don't warn about whitespace in font family name
Summary: Don't warn about whitespace in font family name
Status: NEW
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 3 (show other bugs)
Version: CSS Validator
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 06:36 UTC by Simon Pieters
Modified: 2012-03-27 13:49 UTC (History)
2 users (show)

See Also:


Attachments

Description Simon Pieters 2012-03-14 06:36:59 UTC
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.whatwg.org%2Fstyle%2Fspecification&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en

Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space.

This doesn't match current CSS specs

http://dev.w3.org/csswg/css3-fonts/#propdef-font-family
http://www.w3.org/TR/CSS21/fonts.html#font-family-prop

In practice I think it is pointless to warn about whitespace in unquoted font family names, since they are harmless. What is problematic is unquoted family names that start with a digit or contains punctuation, and that applies even if the name contains *no* whitespace. So either you should warn about all unquoted identifiers and say that names that start with a digit or contains punctuation will break, or don't warn about valid unquoted identifiers at all.
Comment 1 Mathias Bynens 2012-03-27 13:49:14 UTC
The warning that is currently displayed only makes sense in extreme edge cases, like when the font family name actually contains two or more consecutive space characters, e.g. `Foo    Bar`. In that case, you’d need to use quotes: `font-family: 'Foo    Bar'`. If you’d use `font-family: Foo    Bar` (without the quotes) instead, it would get interpreted as `font-family: 'Foo Bar'`, with only a single space, which wouldn’t match the desired font family name.