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

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

Issue 413763004: Get rid of unnecessary isChildNodeList() virtual call in clearChildNodeListCache() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 8964573589802af05f0155a52ba02ac8b493e9a8..6b309481c8cf553d85f2e3fd637342ea5e202428 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -1315,6 +1315,28 @@ void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod
}
}
+void ContainerNode::invalidateNodeListCachesInAncestors(const QualifiedName* attrName, Element* attributeOwnerElement)
+{
+ if (hasRareData() && (!attrName || isAttributeNode())) {
+ if (NodeListsNodeData* lists = rareData()->nodeLists())
+ lists->clearChildNodeListCache();
+ }
+
+ // Modifications to attributes that are not associated with an Element can't invalidate NodeList caches.
+ if (attrName && !attributeOwnerElement)
+ return;
+
+ if (!document().shouldInvalidateNodeListCaches(attrName))
+ return;
+
+ document().invalidateNodeListCaches(attrName);
+
+ for (ContainerNode* node = this; node; node = node->parentNode()) {
+ if (NodeListsNodeData* lists = node->nodeLists())
+ lists->invalidateCaches(attrName);
+ }
+}
+
PassRefPtrWillBeRawPtr<TagCollection> ContainerNode::getElementsByTagName(const AtomicString& localName)
{
if (localName.isNull())

Powered by Google App Engine
This is Rietveld 408576698