REGRESSION(r121232): named properties on document and window may return wrong object
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 19:48:29 +0000 (19:48 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 19:48:29 +0000 (19:48 +0000)
commit707f15b5882b27a6fdf81e40163b2de41eed3024
tree6fa9ffc486a960dfc8ac5ef2a4900f4a69598e40
parentdab1eb986521859f6bf3eba030f77e4042f5d79b
REGRESSION(r121232): named properties on document and window may return wrong object
https://bugs.webkit.org/show_bug.cgi?id=90133

Reviewed by Andreas Kling.

Source/WebCore:

Fixed the bug. Also replaced hasAnyItem by isEmpty (hasAnyItem() is equivalent to !isEmpty()).

Test: fast/dom/HTMLDocument/named-item-multiple-match.html

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::namedPropertyGetter):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::GetNamedProperty):
* html/HTMLCollection.h:
(WebCore::HTMLCollection::isEmpty):
(WebCore::HTMLCollection::hasExactlyOneItem):

LayoutTests:

Add a regression test.

* fast/dom/HTMLDocument/named-item-multiple-match-expected.txt: Added.
* fast/dom/HTMLDocument/named-item-multiple-match.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
Source/WebCore/html/HTMLCollection.h