Closed Bug 47979 Opened 24 years ago Closed 22 years ago

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

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: geschild, Assigned: attinasi)

References

()

Details

(Keywords: html4, testcase, Whiteboard: recommend WONTFIX: handling of invalid markup)

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,

Gaby
Confirmed on Build 2000080804 On Linux (RH 6.2)

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

<P ID="1">
This sentence should be black, not red.
</P>
over to style system. confirmed 080808 win32 mozilla build
Assignee: asa → pierre
Status: UNCONFIRMED → NEW
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.
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
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: html4.01
OS: Windows NT → All
Hardware: PC → All
Changing the summary to reflect the bug, reassigning to Parser and recommending 
we Future this for later when we make standard mode more strict.

See http://www.w3.org/TR/html401/types.html#type-id
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
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
Status: NEW → ASSIGNED
Component: Parser → Layout
*** Bug 63794 has been marked as a duplicate of this bug. ***
*** Bug 62037 has been marked as a duplicate of this bug. ***
*** Bug 71564 has been marked as a duplicate of this bug. ***
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
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).
QA Contact: bsharma → moied
*** Bug 158638 has been marked as a duplicate of this bug. ***
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)
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
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → WONTFIX
removing blocking of bug 7954 since the spec doesn't define what to do for
errorous docs
No longer blocks: html4.01
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.