Created attachment 482514 [details] 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 :(