HTMLOptionsCollection's namedItem and name getter should return the first item
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2013 18:32:06 +0000 (18:32 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2013 18:32:06 +0000 (18:32 +0000)
commitfe544ba428b2a354568cb21f95721f9d71066780
tree9dcf3cd686a2c184e9c72d0c8d14e8f5b0080c3b
parent07cd4efcf4a68faf836de37355eb2da4e5a7c895
HTMLOptionsCollection's namedItem and name getter should return the first item
https://bugs.webkit.org/show_bug.cgi?id=115150

Reviewed by Andreas Kling.

Source/WebCore:

Following the resolution in http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038355.html,
the spefication has been updated to only return the first item when there are multiple items of the same name
in HTMLOptionsCollection; this new behavior matches that of Firefox and Opera (Presto).

Implement this new behavior to remove the custom binding code and use the fast path in namedItem and name
getter of HTMLOptionsCollection. (Obtaining all items for a given name is expensive!).

Tests: fast/dom/HTMLSelectElement/named-options.html
       fast/dom/html-collections-named-getter.html

* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore): Removed the custom bindings for name getter and namedItem.
* html/HTMLOptionsCollection.idl:

LayoutTests:

Changed the expectations of the tests.

* fast/dom/HTMLSelectElement/named-options-expected.txt:
* fast/dom/HTMLSelectElement/script-tests/named-options.js:
* fast/dom/html-collections-named-getter-expected.txt:
* fast/dom/html-collections-named-getter.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLSelectElement/named-options-expected.txt
LayoutTests/fast/dom/HTMLSelectElement/script-tests/named-options.js
LayoutTests/fast/dom/html-collections-named-getter-expected.txt
LayoutTests/fast/dom/html-collections-named-getter.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
Source/WebCore/html/HTMLOptionsCollection.idl