Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Unified Diff: Source/core/dom/LiveNodeList.cpp

Issue 159503003: Do not cause unnecessary node lists invalidation on id/name attribute change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/LiveNodeList.h ('k') | Source/core/dom/NodeRareData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeList.cpp
diff --git a/Source/core/dom/LiveNodeList.cpp b/Source/core/dom/LiveNodeList.cpp
index 21d078323f9031a1ea2f5d746d4381750948d0b3..d43ce2f541815711ce5d4b231688acc7fa8415be 100644
--- a/Source/core/dom/LiveNodeList.cpp
+++ b/Source/core/dom/LiveNodeList.cpp
@@ -35,6 +35,13 @@ ContainerNode& LiveNodeListBase::rootNode() const
return *m_ownerNode;
}
+void LiveNodeListBase::didMoveToDocument(Document& oldDocument, Document& newDocument)
+{
+ invalidateCache(&oldDocument);
+ oldDocument.unregisterNodeList(this);
+ newDocument.registerNodeList(this);
+}
+
void LiveNodeListBase::invalidateIdNameCacheMaps() const
{
ASSERT(hasIdNameCache());
@@ -46,7 +53,7 @@ Node* LiveNodeList::virtualOwnerNode() const
return ownerNode();
}
-void LiveNodeList::invalidateCache() const
+void LiveNodeList::invalidateCache(Document*) const
{
m_collectionIndexCache.invalidate();
}
« no previous file with comments | « Source/core/dom/LiveNodeList.h ('k') | Source/core/dom/NodeRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698