HTMLCollection should use the same storage as DynamicNodeList
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2012 21:38:24 +0000 (21:38 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2012 21:38:24 +0000 (21:38 +0000)
commit610c025580f3957f1b4be0457afa3baff0184f9f
tree852658a34300c01aea61d5471d096327fffcad73
parented90dfbaa76ec279755084c8d95b3345847ab6e9
HTMLCollection should use the same storage as DynamicNodeList
https://bugs.webkit.org/show_bug.cgi?id=102886

Reviewed by Antti Koivisto.

This patch removes ElementRareData::m_collection. HTMLCollections are now held by
NodeListNodeData in NodeRareData like DynamicNodeLists. This simplifies several
Element and Node functions where we used to call into both ElementRareData and
NodeRareData to invalidate caches.

This is a refactoring and there should be no behavioral change.

* dom/DynamicNodeList.h:
* dom/Element.cpp:
(WebCore::ElementRareData::ensureCachedHTMLCollection):
* dom/ElementRareData.cpp:
(WebCore::ElementRareData::reportMemoryUsage):
* dom/ElementRareData.h:
(ElementRareData):
(WebCore::ElementRareData::cachedHTMLCollection):
(WebCore::ElementRareData::removeCachedHTMLCollection):
* dom/Node.cpp:
(WebCore::Node::invalidateNodeListCachesInAncestors):
* dom/NodeRareData.h:
(NodeListsNodeData):
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::cacheWithAtomicName):
(WebCore::NodeListsNodeData::removeCacheWithAtomicName):
(WebCore::NodeListsNodeData::adoptTreeScope):
(WebCore::NodeListsNodeData::namedNodeListKey):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::create):
* html/HTMLFormControlsCollection.h:
(HTMLFormControlsCollection):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::create):
* html/HTMLOptionsCollection.h:
(HTMLOptionsCollection::create):
* html/HTMLPropertiesCollection.h:
(HTMLPropertiesCollection::create):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::create):
* html/HTMLTableRowsCollection.h:
(HTMLTableRowsCollection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DynamicNodeList.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ElementRareData.cpp
Source/WebCore/dom/ElementRareData.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/NodeRareData.h
Source/WebCore/dom/TreeScopeAdopter.cpp
Source/WebCore/html/HTMLFormControlsCollection.cpp
Source/WebCore/html/HTMLFormControlsCollection.h
Source/WebCore/html/HTMLOptionsCollection.cpp
Source/WebCore/html/HTMLOptionsCollection.h
Source/WebCore/html/HTMLPropertiesCollection.h
Source/WebCore/html/HTMLTableRowsCollection.cpp
Source/WebCore/html/HTMLTableRowsCollection.h