Bug 115150

Summary: HTMLOptionsCollection's namedItem and name getter should return the first item
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: arv, benjamin, buildbot, commit-queue, darin, esprehn+autocc, haraken, kling, koivisto, kojih, ojan, rniwa, sam, syoichi
Priority: P2 Keywords: WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 101311    
Bug Blocks:    
Attachments:
Description Flags
Fixes the bug
none
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion
none
Fixed baselines none

Description Ryosuke Niwa 2013-04-25 00:06:28 PDT
In http://trac.webkit.org/changeset/135093, I've made only HTMLOptionsCollection and HTMLFormControlsCollection's namedItem and name getter return node lists when there are multiple items of the same name.

However, the specification has since been updated so that HTMLOptionsCollection::namedItem and its named getter only returns the first item when there are multiple items of the same name.
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmloptionscollection

Fix this so that we can speed-up namedItem and name getter of HTMLOptionsCollection.
Comment 1 Ryosuke Niwa 2013-04-25 00:18:45 PDT
Created attachment 199623 [details]
Fixes the bug
Comment 2 Build Bot 2013-04-25 00:53:17 PDT
Comment on attachment 199623 [details]
Fixes the bug

Attachment 199623 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/139504

New failing tests:
fast/dom/HTMLSelectElement/named-options.html
fast/dom/html-collections-named-getter.html
Comment 3 Build Bot 2013-04-25 00:53:19 PDT
Created attachment 199626 [details]
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-03  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
Comment 4 Ryosuke Niwa 2013-04-25 01:28:51 PDT
Created attachment 199632 [details]
Fixed baselines
Comment 5 Andreas Kling 2013-04-25 05:39:17 PDT
Comment on attachment 199632 [details]
Fixed baselines

Very nice!
r=me
Comment 6 WebKit Commit Bot 2013-04-25 11:31:00 PDT
Comment on attachment 199632 [details]
Fixed baselines

Clearing flags on attachment: 199632

Committed r149126: <http://trac.webkit.org/changeset/149126>
Comment 7 WebKit Commit Bot 2013-04-25 11:31:03 PDT
All reviewed patches have been landed.  Closing bug.