diff options
Diffstat (limited to 'Source/WebCore/dom/Node.cpp')
-rw-r--r-- | Source/WebCore/dom/Node.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp index 5b173bf..facb694 100644 --- a/Source/WebCore/dom/Node.cpp +++ b/Source/WebCore/dom/Node.cpp @@ -628,12 +628,8 @@ void Node::setNodeValue(const String& /*nodeValue*/, ExceptionCode& ec) PassRefPtr<NodeList> Node::childNodes() { NodeListsNodeData* data = ensureRareData()->ensureNodeLists(this); - if (data->m_childNodeListCache) - return PassRefPtr<ChildNodeList>(data->m_childNodeListCache); - RefPtr<ChildNodeList> childNodeList = ChildNodeList::create(this); - data->m_childNodeListCache = childNodeList.get(); - return childNodeList.release(); + return ChildNodeList::create(this, data->m_childNodeListCaches.get()); } Node *Node::lastDescendant() const @@ -1149,16 +1145,6 @@ void Node::removeCachedLabelsNodeList(DynamicNodeList* list) data->m_labelsNodeListCache = 0; } -void Node::removeCachedChildNodeList(DynamicNodeList* list) -{ - ASSERT(rareData()); - ASSERT(rareData()->nodeLists()); - ASSERT_UNUSED(list, list->hasOwnCaches()); - - NodeListsNodeData* data = rareData()->nodeLists(); - data->m_childNodeListCache = 0; -} - Node* Node::traverseNextNode(const Node* stayWithin) const { prefetchTarget(); @@ -2504,8 +2490,7 @@ void Node::formatForDebugger(char* buffer, unsigned length) const void NodeListsNodeData::invalidateCaches() { - if (m_childNodeListCache) - m_childNodeListCache->invalidateCache(); + m_childNodeListCaches->reset(); if (m_labelsNodeListCache) m_labelsNodeListCache->invalidateCache(); @@ -2536,7 +2521,7 @@ bool NodeListsNodeData::isEmpty() const if (!m_listsWithCaches.isEmpty()) return false; - if (m_childNodeListCache) + if (m_childNodeListCaches->refCount()) return false; TagNodeListCacheNS::const_iterator tagCacheEndNS = m_tagNodeListCacheNS.end(); |