If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

ID selector cannot begin with digit

VERIFIED INVALID

Status

()

Core
CSS Parsing and Computation
P3
trivial
VERIFIED INVALID
18 years ago
14 years ago

People

(Reporter: James Scott, Assigned: Peter Linss)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
CSS1 spec says ID selectors can't begin with digits. Build 1999100715 renders
the listed URL improperly - sentence reading "this sentence should be black,
not red" is in fact red. ID is described as "#1".
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
(Assignee)

Comment 1

18 years ago
CSS2 no longer has this restriction.

Updated

18 years ago
Status: RESOLVED → VERIFIED

Comment 2

18 years ago
Verified invalid

Comment 3

18 years ago
*** Bug 22434 has been marked as a duplicate of this bug. ***

Comment 4

18 years ago
Also discussed in bug 18936.

Comment 5

18 years ago
*** Bug 37970 has been marked as a duplicate of this bug. ***
*** Bug 223858 has been marked as a duplicate of this bug. ***
Could you indicate where in CSS2 it says that ID's can start with a Digit as
indicated in comment 2?

I just checked CSS2 and the drafts of CSS2.1 and CSS3, the three documents say
that it is not allowed. I also looked for erratas that would have been published
and public CSS discussion lists, all the messages I found say that identifiers
can't start with a digit. 

http://www.w3.org/TR/CSS2/syndata.html#q4
http://www.w3.org/TR/CSS21/syndata.html#q6
http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#characters

More specifically, this bug seems to be consider as invalid because you consider
that chapter 4 of CSS2 should follow the grammar 
" ID selectors match the HASH production which is "#"{name}, where name is
{nmchar}+ (as opposed to ident, which is {nmstart}{nmchar}*)"
http://bugzilla.mozilla.org/show_bug.cgi?id=18936#c4

But on the CSS list, Bert Boss responding to Ian Hickson about it said : 
"Indeed. This error in the grammar seems to haunt us, and this time
again we forgot to correct it :-( The intention is that class names
may not start with a digit, so the error is in the grammar."
http://lists.w3.org/Archives/Public/www-style/1999Jan/0034.html

I have to say that I am a bit confused, the grammar is difficult to read and
understand since I am no computer scientist but I have the feeling that
"#"{name} was thought to allow hexadecimal color values, not for ID's, otherwise
why wasn't it changed in chapter 4.1.3 of CSS2.1 which is a Last Call Working
Draft ?
You need to log in before you can comment on or make changes to this bug.