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

Unified Diff: Source/core/dom/Document.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 | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 7d98dc56b77c828756dc905535848fdee6d2403b..89100152a7cb61a22bfd45f4af891c365aaabc3a 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -649,6 +649,8 @@ public:
void registerNodeList(LiveNodeListBase*);
void unregisterNodeList(LiveNodeListBase*);
+ void incrementNodeListWithIdNameCacheCount();
+ void decrementNodeListWithIdNameCacheCount();
bool shouldInvalidateNodeListCaches(const QualifiedName* attrName = 0) const;
void invalidateNodeListCaches(const QualifiedName* attrName);
@@ -1367,6 +1369,17 @@ inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type
return origin >= m_legacyViewportDescription.type;
}
+inline void Document::incrementNodeListWithIdNameCacheCount()
+{
+ m_nodeListCounts[InvalidateOnIdNameAttrChange]++;
+}
+
+inline void Document::decrementNodeListWithIdNameCacheCount()
+{
+ ASSERT(m_nodeListCounts[InvalidateOnIdNameAttrChange] > 0);
+ m_nodeListCounts[InvalidateOnIdNameAttrChange]--;
+}
+
DEFINE_TYPE_CASTS(Document, ExecutionContextClient, client, client->isDocument(), client.isDocument());
DEFINE_TYPE_CASTS(Document, ExecutionContext, context, context->isDocument(), context.isDocument());
DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode());
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698