Reviewed by Dave.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2004 01:44:59 +0000 (01:44 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2004 01:44:59 +0000 (01:44 +0000)
commita27fb5ec2ffd203b0d076c47665ab51a81240153
treea33cb2a130dbc22400e2d2e8e5a68c260c229fa5
parente074e7bb31b1502968d22fe16d32dbbb3923ff4b
    Reviewed by Dave.

<rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
<rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)

This avoids the O(N^2) penalty for named item traversal for form collections.

It also combines the item traversal logic for all non-form
collection operations into a single traverseNextItem
function. This avoids having 5 copies of the big switch statement
for this.

Also fixed a bug that prevented the last form element from being removed properly.

        * khtml/html/html_formimpl.cpp:
        (DOM::removeFromVector):
* khtml/dom/html_misc.cpp:
        (HTMLCollection::namedItems):
        * khtml/dom/html_misc.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::getNamedItems):
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem):
        (HTMLCollectionImpl::calcLength):
        (HTMLCollectionImpl::length):
        (HTMLCollectionImpl::item):
        (HTMLCollectionImpl::nextItem):
        (HTMLCollectionImpl::checkForNameMatch):
        (HTMLCollectionImpl::namedItem):
        (HTMLCollectionImpl::namedItems):
        (HTMLCollectionImpl::nextNamedItem):
        (HTMLFormCollectionImpl::calcLength):
        (HTMLFormCollectionImpl::namedItem):
        (HTMLFormCollectionImpl::nextNamedItem):
        (HTMLFormCollectionImpl::namedItems):
        * khtml/html/html_miscimpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog-2005-08-23
WebCore/khtml/dom/html_misc.cpp
WebCore/khtml/dom/html_misc.h
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/html/html_formimpl.cpp
WebCore/khtml/html/html_miscimpl.cpp
WebCore/khtml/html/html_miscimpl.h