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/common-dom-interfaces.html Multipage: http://www.whatwg.org/C#htmlformcontrolscollection-0 Complete: http://www.whatwg.org/c#htmlformcontrolscollection-0 Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/ Comment: Supported property names on HTMLFormControlsCollection should probably not be enumerable Posted from: 98.110.194.132 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Firefox/31.0
Note that HTMLCollection's named properties recently became non-enumerable due to compat issues. I think HTMLFormControlsCollection should be consistent with HTMLCollection here.
HTMLFormControlsCollection: (document.forms[0].elements) http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2986 Chrome exposes the names, Safari and Firefox do not. (check ...elements.a) HTMLAllCollection: (document.all) http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2987 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2988 Chrome exposes the names, Safari does not; Firefox doesn't enumerate anything. HTMLOptionsCollection: (document.forms[0].elements[0].options) http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2989 Chrome exposes the names, Safari and Firefox do not. HTMLCollection: (document.images) http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2990 Chrome exposes the names, Safari and Firefox do not. Anyone got a recent IE to test with? What were the compat issues? Do you have a bug I could look at?
Which Firefox and Chrome versions did you test? Both have changed behavior recently in various directions on this stuff. It sounds like you're testing a Firefox nightly, right? In any case, the compat issues were https://bugzilla.mozilla.org/show_bug.cgi?id=843840 and its duplicates. There was a W3C bug tracking the HTMLCollection change; that got fixed. Running your testcases through IE11, I see: HTMLFormControlsCollection: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2986 IE exposes the names but not the numbers. Note that if the elements don't have names it'll make up names for them and expose them. HTMLAllCollection http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2987 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2988 IE exposes both, afaict. HTMLOptionsCollection: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2989 IE exposes the numbers but not the names. Note that in IE select.options === select as far as I can tell(!). HTMLCollection: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2990 IE exposes the names but not the numbers. Note that if the elements don't have names it'll make up names for them and expose them.
In theory I was testing nightlies of everything, but sometimes they get behind a bit. Yeah, in IE select.options===select, which has been a continuous source of amusement. What kinds of names is it exposing when it has to make some up? That's crazy behaviour. Let's ignore IE here! Ok, so the story here is that Chrome and Firefox changed to match the specs and then Firefox changed back and Chrome is the hold-out because it hasn't reverted? I'll change the spec to not expose named properties in any of these cases.
Checked in as WHATWG revision r8599. Check-in comment: Make the 'supported property names' unenumerable on objects that descend from HTMLCollection. http://html5.org/tools/web-apps-tracker?from=8598&to=8599
> What kinds of names is it exposing when it has to make some up? Hmm. I might not have remembered quite right. On http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2998 IE 11 enumerates these property names: 0, xyz, 2. I could have sworn there were cases when it made up names too (at least in IE9), but I can't reproduce that now. :( > the story here is that Chrome and Firefox changed to match the specs and then > Firefox changed back and Chrome is the hold-out because it hasn't reverted? Yep. > I'll change the spec to not expose named properties in any of these cases. Thanks!
*** Bug 25124 has been marked as a duplicate of this bug. ***