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