Get rid of firstItem and nextItem from HTMLCollection
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 06:29:58 +0000 (06:29 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 06:29:58 +0000 (06:29 +0000)
commitd50a665fd92da96ac24164ccbca70aa5a4d3b22b
tree5d0c3a17c8e44b80f745a97b7eeab689c04ffa6d
parent368dcbe00de1ad6a72c61afafe9f0e8eb905660f
Get rid of firstItem and nextItem from HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=89923

Reviewed by Andreas Kling.

Source/WebCore:

Removed HTMLCollection::firstItem and HTMLCollection::nextItem.
Also added hasAnyItem() and hasExactlyOneItem() to HTMLCollection so that named getter on Document
doesn't need to compute the full length before returning a HTMLCollection.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::getDocumentLinks):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::namedPropertyGetter):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::GetNamedProperty):
* dom/Document.cpp:
(WebCore::Document::openSearchDescriptionURL):
* html/HTMLCollection.cpp:
(WebCore::shouldIncludeChildren):
(WebCore::HTMLCollection::HTMLCollection):
(WebCore):
(WebCore::HTMLCollection::item):
* html/HTMLCollection.h:
(HTMLCollection):
(WebCore::HTMLCollection::hasAnyItem):
(WebCore::HTMLCollection::hasExactlyOneItem):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):

Source/WebKit/chromium:

Re-implement WebNodeCollection::firstItem() and WebNodeCollection::nextItem() in WebKit code
because we got rid of it from WebCore implementation.

This is an extremely poor API and we shouldn't be exposing it in the future.

* public/WebNodeCollection.h:
(WebKit::WebNodeCollection::WebNodeCollection):
(WebNodeCollection):
* src/WebNodeCollection.cpp:
(WebKit::WebNodeCollection::nextItem):
(WebKit::WebNodeCollection::firstItem):
* src/WebPageSerializerImpl.cpp:
(WebKit::WebPageSerializerImpl::collectTargetFrames):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLCollection.h
Source/WebCore/html/HTMLMapElement.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebNodeCollection.h
Source/WebKit/chromium/src/WebNodeCollection.cpp
Source/WebKit/chromium/src/WebPageSerializerImpl.cpp