Closed Bug 603591 Opened 14 years ago Closed 14 years ago

When getting the element associated with an id using IDTargetObserver, ids with a spaces character are ignored

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mounir, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

Attached file testcase
This is not consistent with .getElementById() which accept spaces in ids even if that's invalid. As a consequence, .form and .list doesn't have the same behavior (see test case).
The testcase only works with a nightly build.
Uh... there should be no such restriction.  Can you point me to the relevant .form and .list code?
And in particular, getElementById and IDTargetObservers use the same exact hashtable...
(In reply to comment #2)
> Uh... there should be no such restriction.  Can you point me to the relevant
> .form and .list code?

GetList:
http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLInputElement.cpp#1110

GetForm:
It's harder because it's returning mForm which is set in different ways, the observer is added like that:
http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsGenericHTMLElement.cpp#2796

AFAIK, there is nothing checking for space characters in the id in those code so I'm assuming the difference comes from the different way we use to get the elements associated with the ids.
Sorry, my testcase was stupid so do I :(
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: