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

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

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/Document.cpp ('k') | Source/core/dom/LiveNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeList.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeList.h
index 60d70b00bb2f7f661c66b620a132abcccb2a2db8..422e6bcc1da1606f86debac787270b7669315c3c 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeList.h
@@ -66,6 +66,7 @@ public:
ContainerNode& rootNode() const;
+ void didMoveToDocument(Document& oldDocument, Document& newDocument);
ALWAYS_INLINE bool hasIdNameCache() const { return !isLiveNodeListType(type()); }
ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeListIsRootedAtDocument || m_rootType == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr; }
ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return static_cast<NodeListInvalidationType>(m_invalidationType); }
@@ -78,7 +79,7 @@ public:
else if (hasIdNameCache() && (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr))
invalidateIdNameCacheMaps();
}
- virtual void invalidateCache() const = 0;
+ virtual void invalidateCache(Document* oldDocument = 0) const = 0;
static bool shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType, const QualifiedName&);
@@ -136,7 +137,7 @@ public:
virtual Node* item(unsigned offset) const OVERRIDE FINAL { return m_collectionIndexCache.nodeAt(*this, offset); }
virtual bool nodeMatches(const Element&) const = 0;
- virtual void invalidateCache() const OVERRIDE FINAL;
+ virtual void invalidateCache(Document* oldDocument) const OVERRIDE FINAL;
bool shouldOnlyIncludeDirectChildren() const { return false; }
// Collection IndexCache API.
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/LiveNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698