Elements in a node list of the form element's name getter should not be added to...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Aug 2013 03:46:42 +0000 (03:46 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Aug 2013 03:46:42 +0000 (03:46 +0000)
commitd921414f28817313956a262c007a15fc6d1742c4
treeae25b77e415ed00f883d07e0fe74cc988668bd4d
parentc8bebe74058ccfcd2ecf420634fb8503b2b51587
Elements in a node list of the form element's name getter should not be added to the past names map
https://bugs.webkit.org/show_bug.cgi?id=120279

Reviewed by Darin Adler.

Source/WebCore:

Don't add the element in the named items to the past names map when there are multiple elements.
This matches IE10's behavior and the specified behavior in HTML5:
http://www.w3.org/TR/2013/WD-html51-20130528/forms.html#dom-form-nameditem

Test: fast/forms/past-names-map-should-not-contain-nodelist-item.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::getNamedElements):

LayoutTests:

Add a regression test.

* fast/forms/past-names-map-should-not-contain-nodelist-item-expected.txt: Added.
* fast/forms/past-names-map-should-not-contain-nodelist-item.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/past-names-map-should-not-contain-nodelist-item-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/past-names-map-should-not-contain-nodelist-item.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormElement.cpp