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 25123 - Supported property names on HTMLFormControlsCollection should probably not be enumerable
Summary: Supported property names on HTMLFormControlsCollection should probably not be...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 25124 (view as bug list)
Depends on:
Blocks: 25124
  Show dependency treegraph
 
Reported: 2014-03-22 15:47 UTC by contributor
Modified: 2014-05-05 22:56 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2014-03-22 15:47:08 UTC
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
Comment 1 Boris Zbarsky 2014-03-22 15:49:01 UTC
Note that HTMLCollection's named properties recently became non-enumerable due to compat issues.  I think HTMLFormControlsCollection should be consistent with HTMLCollection here.
Comment 2 Ian 'Hixie' Hickson 2014-05-01 21:03:17 UTC
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?
Comment 3 Boris Zbarsky 2014-05-01 21:26:12 UTC
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.
Comment 4 Ian 'Hixie' Hickson 2014-05-02 20:30:37 UTC
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.
Comment 5 contributor 2014-05-02 20:31:10 UTC
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
Comment 6 Boris Zbarsky 2014-05-02 21:28:06 UTC
> 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!
Comment 7 Ian 'Hixie' Hickson 2014-05-05 22:56:13 UTC
*** Bug 25124 has been marked as a duplicate of this bug. ***