This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html Multipage: http://www.whatwg.org/C#the-form-element Complete: http://www.whatwg.org/c#the-form-element Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/ Comment: Should indexing form with "" work? Posted from: 98.110.194.206 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20130605 Firefox/24.0
Consider this testcase: <form> <img id=""> </form> <script> alert(document.querySelector("form")[""]); </script> Per spec as written right now this should alert an image element, I think. That's not what it does in at least Gecko and WebKit; I haven't tested trident. It may be better to exclude thing with empty names/ids from this named getter...
Questions I need to research: Does it work with any named getters? Any based on id="" or name=""?
document.images['']: Firefox yes, Chrome yes, Safari no, IE no. select.options['']: Firefox yes, Chrome no, Safari no, IE fails control. document.embeds['']: Firefox yes, Chrome yes, Safari no, IE no. document.links['']: Firefox yes, Chrome yes, Safari no, IE fails control. document.forms['']: Firefox yes, Chrome yes, Safari no, IE no. document.all['']: Firefox no, Chrome no, Safari no, IE no. document['']: Firefox no, Chrome no, Safari no, IE no. window['']: Firefox no, Chrome no, Safari no, IE no. localStorage['']: Firefox yes, Chrome yes, Safari yes, IE yes. form[''] (this bug): Firefox no, Chrome no, Safari no, IE no. TESTCASES: images http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2327 options http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2328 embeds http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2329 links http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2331 forms http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2332 document.all http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2333 document http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2334 window http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2336 localStorage http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2337 form http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2338 I guess I should just omit "" names from all collections, so that everything is consistent. Any objections?
That seems fine to me for all the HTMLCollection bits there. I'm not sure about localStorage, since we have compat with "yes" from everyone and it's a very different beast from the rest...
Yeah, I'll leave localStorage.
Done for HTML. Reassigning to DOM Core for the HTMLCollection objects, since DOM Core took those from HTML a while back.
Checked in as WHATWG revision r8010. Check-in comment: Make the empty string no longer be a possible index for most objects that can be indexed by name. http://html5.org/tools/web-apps-tracker?from=8009&to=8010
+----------------+---------------------------------------------+---------------+ | Test results | Firefox Chrome Safari IE | spec | +----------------+---------------------------------------------+---------------+ | gEBTN - http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2400 | | namedItem | elt n/a n/a null | null | | named getter | elt undefined undefined undefined | undefined | | gEBTNNS - http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2401 | | namedItem | elt n/a n/a null | null | | named getter | elt undefined undefined undefined | undefined | | gEBCN - http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2398 | | namedItem | elt n/a n/a null | null | | named getter | elt undefined undefined undefined | undefined | | children - http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2402 | | namedItem | elt elt undefined null | null | | named getter | elt elt undefined undefined | undefined | +----------------+---------------------------------------------+---------------+ https://github.com/whatwg/dom/commit/35625e7dae457da7b2906b535edfe96ce6c85998
http://w3c-test.org/web-platform-tests/master/dom/collections/HTMLCollection-empty-name.html