<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25123</bug_id>
          
          <creation_ts>2014-03-22 15:47:08 +0000</creation_ts>
          <short_desc>Supported property names on HTMLFormControlsCollection should probably not be enumerable</short_desc>
          <delta_ts>2014-05-05 22:56:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#htmlformcontrolscollection-0</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          <blocked>25124</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102779</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-03-22 15:47:08 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102780</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-03-22 15:49:01 +0000</bug_when>
    <thetext>Note that HTMLCollection&apos;s named properties recently became non-enumerable due to compat issues.  I think HTMLFormControlsCollection should be consistent with HTMLCollection here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104930</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-01 21:03:17 +0000</bug_when>
    <thetext>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&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104932</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-05-01 21:26:12 +0000</bug_when>
    <thetext>Which Firefox and Chrome versions did you test?  Both have changed behavior recently in various directions on this stuff.  It sounds like you&apos;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&apos;t
  have names it&apos;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&apos;t
  have names it&apos;ll make up names for them and expose them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104990</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-02 20:30:37 +0000</bug_when>
    <thetext>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&apos;s crazy behaviour. Let&apos;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&apos;t reverted?

I&apos;ll change the spec to not expose named properties in any of these cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104991</commentid>
    <comment_count>5</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-02 20:31:10 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8599.
Check-in comment: Make the &apos;supported property names&apos; unenumerable on objects that descend from HTMLCollection.
http://html5.org/tools/web-apps-tracker?from=8598&amp;to=8599</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104994</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-05-02 21:28:06 +0000</bug_when>
    <thetext>&gt; 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&apos;t reproduce that now.  :(

&gt; the story here is that Chrome and Firefox changed to match the specs and then
&gt; Firefox changed back and Chrome is the hold-out because it hasn&apos;t reverted?

Yep.

&gt; I&apos;ll change the spec to not expose named properties in any of these cases.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105124</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-05 22:56:13 +0000</bug_when>
    <thetext>*** Bug 25124 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>