HTML ID values begining with digits should be ignored in strict mode




19 years ago
16 years ago


(Reporter: geschild, Assigned: attinasi)


({html4, testcase})

html4, testcase

Firefox Tracking Flags

(Not tracked)


(Whiteboard: recommend WONTFIX: handling of invalid markup, URL)



19 years ago
CSS1 Test Suite: 1.5 ID as selector

This case is handled incorrectly. It shows in red whilst the test says it should
have been black:

"This sentence should be black, not red-- ID selectors cannot begin with digits
in CSS1."

Good luck,


Comment 1

19 years ago
Confirmed on Build 2000080804 On Linux (RH 6.2)

Its specificly refering to stuff like this:
<STYLE type="text/css">
#1 {color: red;}

<P ID="1">
This sentence should be black, not red.

Comment 2

19 years ago
over to style system. confirmed 080808 win32 mozilla build
Assignee: asa → pierre
Component: Browser-General → Style System
Ever confirmed: true
QA Contact: doronr → chrisd
It's an error in the W3C Test Suite. IDs _are_ allowed to start with numbers
(see the spec for yourself) but in HTML they are not.

This is a parser error at best.
Assignee: pierre → rickg
Severity: minor → trivial
Component: Style System → Parser
QA Contact: chrisd → janc
Summary: ID selectors cannot begin with digits in CSS1. → ID selectors cannot begin with digits in HTML.

Comment 4

19 years ago
This is a CSS parser issue not HTML parser. Reassigning bug to pierre.
Assignee: rickg → pierre
No, it's in HTML where IDs can't begin with numbers.  Changing this in the CSS
parser would create a bug that doesn't exist now.
Assignee: pierre → harishd

Comment 6

19 years ago
HTML parser doesn't take the responsibility of validating style content.  As far 
as the HTML parser is concerned style data is just another CDATA and it doesn't 
do anything more than that.  If this cannot be handled in the CSS parser then it 
should be addressed in the style system ( not sure where exactly ).  Giving bug 
back to pierre to investigate.
Assignee: harishd → pierre
Harish -- the problem is not with bad style sheets.  The problem is with bad
HTML being accepted.

Admittedly, the HTML spec doesn't define error handling rules.  But IMO this is
either a bug in the HTML Parser / Content Sink or it's a WONTFIX.
To clarify David's comments -- the problem is that we are not dropping 'ID'
attributes that start with a number. It actually has nothing to do with
stylesheets other than being testable by them.

This would be a strict DTD change probably. (I recommend Future or WONTFIX...)
Blocks: 7954
Keywords: correctness, testcase
OS: Windows NT → All
Hardware: PC → All

Comment 9

19 years ago
Changing the summary to reflect the bug, reassigning to Parser and recommending 
we Future this for later when we make standard mode more strict.

Assignee: pierre → harishd
Summary: ID selectors cannot begin with digits in HTML. → HTML ID values begining with digits should be ignored in strict mode
Target Milestone: --- → Future

Comment 10

19 years ago
Parser doesn't validate attributes ( atleat there's no such support as of today 
).  This should get handled in nsGenericHTMLElements where attriubtes are dealt 
with.  Per Mark, moving this bug back to his plate.
Assignee: harishd → attinasi


19 years ago
Component: Parser → Layout

Comment 11

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

Comment 13

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

Comment 14

18 years ago
heh heh heh
passing qa contact off to hixie.  ;)
QA Contact: janc → ian
Don't look at me, this is Bindu's bug!

(Quick, pass it on, pass it on, pass it on, pass it on,
It's a hot potato, hot potato, hot potato, ...)
QA Contact: ian → bsharma
Whiteboard: recommend WONTFIX: handling of invalid markup

Comment 17

18 years ago
Bernd, that link doesn' tlook right to me. We need to check for this in the
nsGenericHTMLElement::SetAttr method - I think. Some short time in the debugger
around that method might make it clear exactly what needs to happen; feel free
to take it over (it is a low priority for me).


18 years ago
QA Contact: bsharma → moied

Comment 18

17 years ago
*** Bug 158638 has been marked as a duplicate of this bug. ***


17 years ago
Keywords: html4
If we're talking about dropping attributes, this is a DOM bug, not layout...
jst?  sicking?  peterv?  Given that the spec does not describe error handling, I
think the sane thing to do is to allow such ID attributes...
I agree that this is a WONTFIX. We don't validate anything else.

A) We can't do this in non-strict mode
B) Differences between strict and non-strict is bad
C) "Correct" strict behaviour isn't specified anywhere
D) This isn't important to anyone

A+B+C+D => WONTFIX  :-)

(pheer the axiomatic proof)

Comment 21

16 years ago
Is it something to be more concerned about in XML/XHTML at all?
Since we're not validating anything else let's not hack in something especially
for this. Once we have a validating parser (i bet there's a bug on that
somewhere) this will come for free. Until then this is WONTFIX
Last Resolved: 16 years ago
Resolution: --- → WONTFIX
removing blocking of bug 7954 since the spec doesn't define what to do for
errorous docs
No longer blocks: 7954

Comment 24

16 years ago
This could depend on bug 40945, for reference's sake. (I couldn't find an XML
Validation bug, though I suspect it's out there, somewhere.)
You need to log in before you can comment on or make changes to this bug.