Only HTMLAllCollection needs stateful named item traversal.
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2011 14:53:48 +0000 (14:53 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2011 14:53:48 +0000 (14:53 +0000)
commit755cc79e07e5eea4213aebccf3ca41a4206d3c01
treefa919601f7cb50d5b9aa2af54a4f25419baea36d
parent12192254646654451870b1295922cef159c36a88
Only HTMLAllCollection needs stateful named item traversal.
<http://webkit.org/b/71987>

Reviewed by Antti Koivisto.

After the ability to call collections (excluding document.all) was removed
in <http://webkit.org/b/67579>, chunks of code remained in HTMLCollection
and HTMLFormCollection that was only used for this purpose.

Restrict the nextNamedItem() mechanism to HTMLAllCollection, since it's no
longer used by any of the other collections.

* html/HTMLCollection.h:

    Moved nextNamedItem() to HTMLAllCollection (and made it non-virtual.)
    Promoted itemAfter() and checkForNameMatch() to protected methods so
    they can be called from HTMLAllCollection.

* html/HTMLAllCollection.h:
* html/HTMLAllCollection.cpp:
(WebCore::HTMLAllCollection::HTMLAllCollection):
(WebCore::HTMLAllCollection::nextNamedItem):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::namedItem):
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::namedItem):
* html/HTMLFormCollection.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAllCollection.cpp
Source/WebCore/html/HTMLAllCollection.h
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLCollection.h
Source/WebCore/html/HTMLFormCollection.cpp
Source/WebCore/html/HTMLFormCollection.h