Title: [122245] branches/chromium/1180/Source/WebCore/dom
Revision
122245
Author
cev...@google.com
Date
2012-07-10 12:15:45 -0700 (Tue, 10 Jul 2012)

Log Message

Merge 120868
BUG=134088
Review URL: https://chromiumcodereview.appspot.com/10689138

Modified Paths

Diff

Modified: branches/chromium/1180/Source/WebCore/dom/Document.cpp (122244 => 122245)


--- branches/chromium/1180/Source/WebCore/dom/Document.cpp	2012-07-10 19:14:25 UTC (rev 122244)
+++ branches/chromium/1180/Source/WebCore/dom/Document.cpp	2012-07-10 19:15:45 UTC (rev 122245)
@@ -3864,16 +3864,21 @@
 
 void Document::registerDynamicSubtreeNodeList(DynamicSubtreeNodeList* list)
 {
-    ensureRareData()->ensureNodeLists(this)->m_listsInvalidatedAtDocument.add(list);
+    m_listsInvalidatedAtDocument.add(list);
 }
 
 void Document::unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList* list)
 {
-    ASSERT(hasRareData());
-    ASSERT(rareData()->nodeLists());
-    rareData()->nodeLists()->m_listsInvalidatedAtDocument.remove(list);
+    m_listsInvalidatedAtDocument.remove(list);
 }
 
+void Document::clearNodeListCaches()
+{
+    HashSet<DynamicSubtreeNodeList*>::iterator end = m_listsInvalidatedAtDocument.end();
+    for (HashSet<DynamicSubtreeNodeList*>::iterator it = m_listsInvalidatedAtDocument.begin(); it != end; ++it)
+        (*it)->invalidateCache();
+}
+
 void Document::attachNodeIterator(NodeIterator* ni)
 {
     m_nodeIterators.add(ni);

Modified: branches/chromium/1180/Source/WebCore/dom/Document.h (122244 => 122245)


--- branches/chromium/1180/Source/WebCore/dom/Document.h	2012-07-10 19:14:25 UTC (rev 122244)
+++ branches/chromium/1180/Source/WebCore/dom/Document.h	2012-07-10 19:15:45 UTC (rev 122245)
@@ -714,6 +714,7 @@
 
     void registerDynamicSubtreeNodeList(DynamicSubtreeNodeList*);
     void unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList*);
+    void clearNodeListCaches();
 
     void attachNodeIterator(NodeIterator*);
     void detachNodeIterator(NodeIterator*);
@@ -1393,6 +1394,7 @@
     
     OwnPtr<HTMLCollection> m_collections[NumUnnamedDocumentCachedTypes];
     OwnPtr<HTMLAllCollection> m_allCollection;
+    HashSet<DynamicSubtreeNodeList*> m_listsInvalidatedAtDocument;
 
     typedef HashMap<AtomicStringImpl*, OwnPtr<HTMLNameCollection> > NamedCollectionMap;
     NamedCollectionMap m_documentNamedItemCollections;

Modified: branches/chromium/1180/Source/WebCore/dom/DynamicNodeList.h (122244 => 122245)


--- branches/chromium/1180/Source/WebCore/dom/DynamicNodeList.h	2012-07-10 19:14:25 UTC (rev 122244)
+++ branches/chromium/1180/Source/WebCore/dom/DynamicNodeList.h	2012-07-10 19:15:45 UTC (rev 122245)
@@ -104,9 +104,6 @@
     DynamicSubtreeNodeList(PassRefPtr<Node>, RootType = RootedAtNode);
 
 private:
-    using DynamicNodeList::invalidateCache;
-    friend struct NodeListsNodeData;
-
     Node* itemForwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const;
     Node* itemBackwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const;
 };

Modified: branches/chromium/1180/Source/WebCore/dom/Node.cpp (122244 => 122245)


--- branches/chromium/1180/Source/WebCore/dom/Node.cpp	2012-07-10 19:14:25 UTC (rev 122244)
+++ branches/chromium/1180/Source/WebCore/dom/Node.cpp	2012-07-10 19:15:45 UTC (rev 122245)
@@ -967,10 +967,7 @@
         && (attrName != idAttr || !attributeOwnerElement->isFormControlElement()))
         return;
 
-    if (document()->hasRareData()) {
-        if (NodeListsNodeData* nodeLists = document()->rareData()->nodeLists())
-            nodeLists->invalidateCachesForDocument();
-    }
+    document()->clearNodeListCaches();
 
     if (!treeScope()->hasNodeListCaches())
         return;
@@ -992,13 +989,11 @@
     if (hasRareData())
         rareData()->clearChildNodeListCache();
 
-    if (document()->hasRareData()) {
-        if (NodeListsNodeData* nodeLists = document()->rareData()->nodeLists())
-            nodeLists->invalidateCachesForDocument();
-    }
+    document()->clearNodeListCaches();
 
     if (!treeScope()->hasNodeListCaches())
         return;
+
     for (Node* node = this; node; node = node->parentNode()) {
         if (!node->hasRareData())
             continue;
@@ -2325,13 +2320,6 @@
     invalidateCachesThatDependOnAttributes();
 }
 
-void NodeListsNodeData::invalidateCachesForDocument()
-{
-    NodeListsNodeData::NodeListSet::iterator end = m_listsInvalidatedAtDocument.end();
-    for (NodeListsNodeData::NodeListSet::iterator it = m_listsInvalidatedAtDocument.begin(); it != end; ++it)
-        (*it)->invalidateCache();
-}
-
 void NodeListsNodeData::invalidateCachesThatDependOnAttributes()
 {
     ClassNodeListCache::iterator classCacheEnd = m_classNodeListCache.end();
@@ -2349,17 +2337,10 @@
     for (MicroDataItemListCache::iterator it = m_microDataItemListCache.begin(); it != itemListCacheEnd; ++it)
         it->second->invalidateCache();
 #endif
-
-    RadioNodeListCache::iterator radioNodeListCacheEnd = m_radioNodeListCache.end();
-    for (RadioNodeListCache::iterator it = m_radioNodeListCache.begin(); it != radioNodeListCacheEnd; ++it)
-        it->second->invalidateCache();
 }
 
 bool NodeListsNodeData::isEmpty() const
 {
-    if (!m_listsInvalidatedAtDocument.isEmpty())
-        return false;
-
     if (!m_tagNodeListCache.isEmpty())
         return false;
     if (!m_tagNodeListCacheNS.isEmpty())

Modified: branches/chromium/1180/Source/WebCore/dom/NodeRareData.h (122244 => 122245)


--- branches/chromium/1180/Source/WebCore/dom/NodeRareData.h	2012-07-10 19:14:25 UTC (rev 122244)
+++ branches/chromium/1180/Source/WebCore/dom/NodeRareData.h	2012-07-10 19:15:45 UTC (rev 122245)
@@ -51,9 +51,6 @@
 struct NodeListsNodeData {
     WTF_MAKE_NONCOPYABLE(NodeListsNodeData); WTF_MAKE_FAST_ALLOCATED;
 public:
-    typedef HashSet<DynamicSubtreeNodeList*> NodeListSet;
-    NodeListSet m_listsInvalidatedAtDocument;
-
     typedef HashMap<String, ClassNodeList*> ClassNodeListCache;
     ClassNodeListCache m_classNodeListCache;
 
@@ -82,7 +79,6 @@
     }
 
     void invalidateCaches();
-    void invalidateCachesForDocument();
     void invalidateCachesThatDependOnAttributes();
 
     bool isEmpty() const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to