[CSS2.1] Any hope of fixing HASH #{name} to disallow numeric identifiers?

While going through the W3 CSS validator something along the lines of:

#4 { color: green; }

Doesn't pass with a cryptic error message about CSS1 and CSS2 rules for identifiers, but has no mention of CSS2.1. The CSS2.1 "sample" grammar allows for {name} to be {nmchar}+, which specifically allows digits. A failure when parsing means error recovery as opposed to a rule that might never match (for instance, if #4 is an allowed selector, but is a disallowed id in the document language is much different from #4 being a syntax error). If we truly support only support {ident} then we should change this stuff over so it is obvious the errant use of a numeric value will cause.

It is quite obvious that browsers support {ident} here and not {name}. FireFox will throw out the rules for {name} and won't even show them in the OM. They'll allow rules such as:

#-a
#-_
#_

Etc... which are all clearly written to the {ident} grammar.

Justin [MSFT]

Received on Saturday, 19 January 2008 01:11:19 UTC