This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23781 - id and class should be case-insensitive in quirks
Summary: id and class should be case-insensitive in quirks
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-09 02:16 UTC by Simon Pieters
Modified: 2014-05-08 06:23 UTC (History)
7 users (show)

See Also:


Attachments

Description Simon Pieters 2013-11-09 02:16:40 UTC
http://dom.spec.whatwg.org/#concept-id

[[
unique identifier (ID)
]]

HTML says

[[
The unique identifier of HTML elements in documents that are in quirks mode must be treated as ASCII case-insensitive for the purposes of selector matching.

Classes from the class attribute of HTML elements in documents that are in quirks mode must be treated as ASCII case-insensitive for the purposes of selector matching.
]]
http://www.whatwg.org/specs/web-apps/current-work/multipage/selectors.html#case-sensitivity

But this should apply to all elements. It applies to SVG too in browsers and also elements in unknown namespace (in Blink at least, Gecko appears to not support selecting such elements with id selector). Since it applies to all elements it might be good to move to DOM (or be directly in Selectors?).

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2627 (control)
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2628
Comment 1 Boris Zbarsky 2013-11-09 02:32:40 UTC
This only applies to CSS matching, right?  For example, getElementById() still does case-sensitive matching I believe.

Where to spec this is unclear.  Maybe the right place is the quirks mode spec, even.
Comment 2 Anne 2013-11-09 03:15:56 UTC
So either Selectors fully embraces defining matching in terms of the DOM or it keeps doing its somewhat-DOM-somewhat-abstract dance that's leaky as hell or it makes it fully abstract and then I guess DOM should define DOM-to-abstract.
Comment 3 Anne 2013-11-09 03:16:41 UTC
Reassigning to see what Tab thinks.
Comment 4 Tab Atkins Jr. 2013-11-10 17:03:39 UTC
Since we decided on a previous issue to keep CSS quirks in the quirks mode spec, I guess we should do the same for this, too.
Comment 5 Anne 2013-11-11 01:05:55 UTC
Why did you decide that? The quirks mode specification should disappear.
Comment 6 Simon Pieters 2013-11-11 14:22:14 UTC
Selectors isn't CSS, ba-dum-tsh
Comment 7 Ian 'Hixie' Hickson 2014-05-01 22:01:49 UTC
So is the HTML spec wrong here? Or? (This bug isn't assigned to me right now; please do reassign it to me if I should be fixing HTML.)
Comment 8 Anne 2014-05-02 07:53:55 UTC
I think this is a bug in Selectors, unless we really want to override Selectors from Quirks Mode, which seems weird and hard to figure out when implementing, but okay.
Comment 9 Simon Pieters 2014-05-02 11:52:57 UTC
I've specified it in quirks mode for now.
http://quirks.spec.whatwg.org/#the-case-insensitive-class-and-id-selectors-quirk

Hixie, you can drop the part quoted in comment 0 from HTML.
Comment 10 Simon Pieters 2014-05-02 11:56:06 UTC
(But also fix the "everything else" paragraph and maybe point to the quirks spec)
Comment 11 Ian 'Hixie' Hickson 2014-05-02 18:22:18 UTC
Why is it better to have it in quirks than in HTML? Aren't we trying to drive the quirks spec to empty and move everything into other specs?
Comment 12 Ms2ger 2014-05-02 18:31:45 UTC
On the DOM side, yes. Our friends in the CSSWG don't seem inclined that way, though.
Comment 13 Ian 'Hixie' Hickson 2014-05-02 20:42:42 UTC
I'm happy to take care of the CSS stuff that only affects HTML. Does this affect more than HTML? ("Quirks mode" is only possible in text/html, right?)
Comment 14 Anne 2014-05-04 08:45:31 UTC
You can have SVG nodes in HTML and it affects them. Or you can have a document that's in quirks mode and pour nodes in it from another document. We made quirks mode a DOM affair, it seems weird for selector matching of DOM to be an HTML affair.
Comment 15 Ian 'Hixie' Hickson 2014-05-05 22:00:58 UTC
Shouldn't it be in DOM then?

My concern is that the quirks spec is essentially an "errata" spec and that most people won't read it. We need this kind of thing to be immediately visible to implementors.
Comment 16 Ian 'Hixie' Hickson 2014-05-05 22:01:18 UTC
(it really _should_ just be in the selectors spec, of course)
Comment 18 Tab Atkins Jr. 2014-05-07 17:16:55 UTC
(In reply to Anne from comment #17)
> http://krijnhoetmer.nl/irc-logs/whatwg/20140506#l-5

It's in Selectors now: http://dev.w3.org/csswg/selectors/#data-model (look at the end of the section)
Comment 19 Ian 'Hixie' Hickson 2014-05-07 17:49:33 UTC
Cool. (Probably needs a reference to define "quirks mode", BTW, lest people wonder if "limited quirks" mode counts as "quirks mode" here.)

zcorpan, is this all resolved now?
Comment 20 contributor 2014-05-07 17:49:58 UTC
Checked in as WHATWG revision r8610.
Check-in comment: The quirky class/id selector matching case logic moved to selectors
http://html5.org/tools/web-apps-tracker?from=8609&to=8610