JSC/HTMLCollection: Optimize canGetItemsForName().
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Dec 2011 22:21:05 +0000 (22:21 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Dec 2011 22:21:05 +0000 (22:21 +0000)
commitd359f1529a6b10c57cdd628fc9d11eb6ba8cc2a7
tree6419fa0501f0dd402c4acee0a7582a4310c2bb46
parent4136e1b2340b300707b49941435fb3abde0e8082
JSC/HTMLCollection: Optimize canGetItemsForName().
<http://webkit.org/b/74806>

Reviewed by Sam Weinig.

Add HTMLCollection::hasNamedItem(name) and use that in the JSC bindings'
canGetItemsForName() instead of fetching the list of named items just to
check if it's empty or not.

* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::JSHTMLAllCollection::canGetItemsForName):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::canGetItemsForName):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::hasNamedItem):
* html/HTMLCollection.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLCollection.h