Closed Bug 18936 Opened 25 years ago Closed 25 years ago

{css1} ID selector cannot begin with digits

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: teruko, Assigned: pierre)

References

()

Details

(Keywords: css1, Whiteboard: css syntax)

ID selector cannot begin with digits in CSS1.

Steps of reproduce
1. Go to above URL

Look at the second sentence and second sentence in the Table Testing section.

Expected result
  These sentences should be black because ID selector begins with digits.

Actual result
  These sentences are red.

Tested 111508-M12 Win32 and Mac, and 111512-M12 Linux builds.
Summary: {css1} ID selector cannot begin with digits → {css1} ID selector cannot begin with digits
See bug 15868 (Which was resolved invalid because CSS2 allows digits to begin ID
selectors).
That's weird: peterl closed bug 15868 saying that CSS2 no longer has this
restriction but the current spec on http://www.w3.org/TR/REC-CSS2/syndata.html#q4
reads:

    In CSS2, identifiers (including element names, classes, and IDs in selectors)
    can contain only the characters [A-Za-z0-9] and ISO 10646 characters 161
    and higher, plus the hyphen (-); they cannot start with a hyphen or a digit.

I'm not closing it yet, I'll check first.
Ian & David, are you aware of any modification of the CSS2 spec to allow
selectors to start with a digit?
Yes.  See the grammar: http://www.w3.org/TR/REC-CSS2/grammar.html .  ID
selectors match the HASH production which is "#"{name}, where name is
{nmchar}+ (as opposed to ident, which is {nmstart}{nmchar}*)
Looks like YAE (yet another error) in the CSS2 spec. I guess we should post it
to www-style. Sigh. ("sigh" because doing so is unlikely to have much effect to
the errata document, as they are busy working on CSS3. Which IMHO can wait,
since we are no where near getting CSS_2_ implemented correctly yet. But anyway.
Enough griping for one day...)

FWIW, similar problems with the rules for class were discussed in:
   http://lists.w3.org/Archives/Public/www-style/1999Jan/0029.html
   http://lists.w3.org/Archives/Public/www-style/1999Jan/0034.html
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Whiteboard: css syntax
Thank you both. Closed as Invalid.
Status: RESOLVED → VERIFIED
Verified invalid
Keywords: css1
Migrating from {css1} to css1 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
*** Bug 25471 has been marked as a duplicate of this bug. ***
*** Bug 30207 has been marked as a duplicate of this bug. ***
*** Bug 52924 has been marked as a duplicate of this bug. ***
*** Bug 55314 has been marked as a duplicate of this bug. ***
*** Bug 149385 has been marked as a duplicate of this bug. ***
*** Bug 292071 has been marked as a duplicate of this bug. ***
*** Bug 288373 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.