HTMLCollection's caches should be owned by either ElementRareData or Document
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 23:56:42 +0000 (23:56 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 23:56:42 +0000 (23:56 +0000)
commitf4f32ae5cba512209ea789bc959763016710f6a1
tree87d27e1b4445b2212432838809f7d358da5d921c
parent59aa6a7e39f41dba6fa4d69b9aaff24d55b1f383
HTMLCollection's caches should be owned by either ElementRareData or Document
https://bugs.webkit.org/show_bug.cgi?id=90322

Reviewed by Anders Carlsson.

Removed all instances of OwnPtr<HTMLCollection> except ones on ElementRareData and Document.
ElementRareData::ensureCachedHTMLCollection then polymorphically creates HTMLCollection or
its subclass as deemed necessary.

This refactoring allows us to move HTMLCollection to use the same invalidation model as
DynamicNodeList (invalidated during DOM mutations) in a follow up.

* dom/Document.cpp:
(WebCore::Document::all):
* dom/Document.h:
(Document):
* dom/Element.cpp:
(WebCore::ElementRareData::ensureCachedHTMLCollection):
(WebCore):
(WebCore::Element::cachedHTMLCollection):
* dom/Element.h:
(Element):
* dom/ElementRareData.h:
(WebCore):
(ElementRareData):
(WebCore::ElementRareData::cachedHTMLCollection):
* dom/Node.cpp:
(WebCore):
* dom/Node.h:
(Node):
* dom/NodeRareData.h:
(WebCore::NodeRareData::setItemType):
(NodeRareData):
* html/CollectionType.h:
* html/HTMLCollection.cpp:
(WebCore::shouldIncludeChildren):
(WebCore::HTMLCollection::isAcceptableElement):
* html/HTMLElement.cpp:
(WebCore):
(WebCore::HTMLElement::properties):
* html/HTMLElement.h:
(HTMLElement):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::elements):
* html/HTMLFieldSetElement.h:
(HTMLFieldSetElement):
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::HTMLFormCollection):
(WebCore::HTMLFormCollection::create):
* html/HTMLFormCollection.h:
(HTMLFormCollection):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::elements):
* html/HTMLFormElement.h:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
(WebCore::HTMLOptionsCollection::create):
* html/HTMLOptionsCollection.h:
(HTMLOptionsCollection):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::selectedOptions):
(WebCore::HTMLSelectElement::options):
(WebCore::HTMLSelectElement::invalidateSelectedItems):
(WebCore::HTMLSelectElement::setRecalcListItems):
* html/HTMLSelectElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::rows):
* html/HTMLTableElement.h:
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
(WebCore::HTMLTableRowsCollection::create):
* html/HTMLTableRowsCollection.h:
(HTMLTableRowsCollection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementRareData.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeRareData.h
Source/WebCore/html/CollectionType.h
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFieldSetElement.h
Source/WebCore/html/HTMLFormCollection.cpp
Source/WebCore/html/HTMLFormCollection.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLOptionsCollection.cpp
Source/WebCore/html/HTMLOptionsCollection.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableElement.h
Source/WebCore/html/HTMLTableRowsCollection.cpp
Source/WebCore/html/HTMLTableRowsCollection.h