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

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

RESOLVED WONTFIX

Status

()

Core
Layout
P3
trivial
RESOLVED WONTFIX
17 years ago
15 years ago

People

(Reporter: geschild, Assigned: Marc Attinasi)

Tracking

({html4, testcase})

Trunk
Future
html4, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

(Reporter)

Description

17 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,

Gaby

Comment 1

17 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;}
</STYLE>

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

Comment 2

17 years ago
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.

Comment 4

17 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

17 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
(Assignee)

Comment 9

17 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.

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

Comment 10

17 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
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Component: Parser → Layout

Comment 11

17 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

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

Comment 14

17 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 16

16 years ago
could this be handled around
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsGenericHTMLElement.cpp#1988
?
(Assignee)

Comment 17

16 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).

Updated

16 years ago
QA Contact: bsharma → moied

Comment 18

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

Updated

15 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

15 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
Status: ASSIGNED → RESOLVED
Last Resolved: 15 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

15 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.