 Chromium Code Reviews
 Chromium Code Reviews Issue 159503003:
  Do not cause unnecessary node lists invalidation on id/name attribute change  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 159503003:
  Do not cause unnecessary node lists invalidation on id/name attribute change  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| Index: Source/core/dom/Document.h | 
| diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h | 
| index 4fa870bdcf8ccd59138f293e85766194fe2c40c7..d2c5d8c8e68a1bb9e646363b459eff6d41f3f829 100644 | 
| --- a/Source/core/dom/Document.h | 
| +++ b/Source/core/dom/Document.h | 
| @@ -650,6 +650,8 @@ public: | 
| void registerNodeList(LiveNodeListBase*); | 
| void unregisterNodeList(LiveNodeListBase*); | 
| + void incrementNodeListWithIdNameCacheCount(); | 
| + void decrementNodeListWithIdNameCacheCount(); | 
| bool shouldInvalidateNodeListCaches(const QualifiedName* attrName = 0) const; | 
| void invalidateNodeListCaches(const QualifiedName* attrName); | 
| @@ -1377,6 +1379,17 @@ inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type | 
| return origin >= m_legacyViewportDescription.type; | 
| } | 
| +inline void Document::incrementNodeListWithIdNameCacheCount() | 
| +{ | 
| + m_nodeListCounts[InvalidateOnIdNameAttrChange]++; | 
| 
eseidel
2014/02/12 01:55:24
This seems about the same size as just keeping a l
 
Inactive
2014/02/12 02:21:41
You mean an array of linked lists (whose items wou
 | 
| +} | 
| + | 
| +inline void Document::decrementNodeListWithIdNameCacheCount() | 
| +{ | 
| + ASSERT(m_nodeListCounts[InvalidateOnIdNameAttrChange] > 0); | 
| 
Inactive
2014/02/12 02:21:41
You mentioned having good assertions an IRC. There
 | 
| + 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()); |