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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>148880</bug_id>
          
          <creation_ts>2015-09-04 20:33:46 -0700</creation_ts>
          <short_desc>HTMLOptionsCollection.namedItem should return a NodeList when there are multiple matching nodes</short_desc>
          <delta_ts>2016-10-12 12:55:36 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Keith Rollin">krollin</assigned_to>
          <cc>cdumez</cc>
    
    <cc>krollin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1123848</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2015-09-04 20:33:46 -0700</bug_when>
    <thetext>See https://html.spec.whatwg.org/multipage/infrastructure.html#htmloptionscollection

Unlike named getters, we must return a NodeList that contain the list of all matching nodes in HTMLOptionCollection.namedItem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123849</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2015-09-04 20:34:23 -0700</bug_when>
    <thetext>This bug was found by the newly added test:
LayoutTests/http/tests/w3c/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1123850</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-09-04 20:34:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/22590497&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133144</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2015-10-14 09:52:12 -0700</bug_when>
    <thetext>Where is this in the spec?

The IDL says namedItem() returns an Element. And there is this comment:
&quot;&quot;&quot;
element = collection . namedItem(name)
element = collection[name]
Returns the item with ID or name name from the collection.

If there are multiple matching items, then the first is returned.
&quot;&quot;&quot;

Therefore, the spec seems to indicate we should NOT return a NodeList. Maybe it is a bug in the test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133173</commentid>
    <comment_count>4</comment_count>
    <who name="Keith Rollin">krollin</who>
    <bug_when>2015-10-14 10:45:39 -0700</bug_when>
    <thetext>I&apos;ve filed a w3c-test bug: https://github.com/w3c/web-platform-tests/issues/2255</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1139033</commentid>
    <comment_count>5</comment_count>
    <who name="Keith Rollin">krollin</who>
    <bug_when>2015-11-03 12:48:23 -0800</bug_when>
    <thetext>I&apos;ve submitted a patch to the test and create a pull-request: https://github.com/w3c/web-platform-tests/pull/2302</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1239438</commentid>
    <comment_count>6</comment_count>
    <who name="Keith Rollin">krollin</who>
    <bug_when>2016-10-12 12:55:36 -0700</bug_when>
    <thetext>Merged and closed (back in February).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>