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

Unified Diff: Source/core/html/HTMLCollection.cpp

Issue 240273005: Simplify the HTMLCollection destructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comments Created 6 years, 8 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
« Source/core/html/CollectionType.h ('K') | « Source/core/html/CollectionType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCollection.cpp
diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
index b66fa9d26d5ea5003523c4402deb4ef231e56878..42f5c65f8be8be9ae8f8a78990043b065f57cb05 100644
--- a/Source/core/html/HTMLCollection.cpp
+++ b/Source/core/html/HTMLCollection.cpp
@@ -175,11 +175,9 @@ HTMLCollection::~HTMLCollection()
{
if (hasValidIdNameCache())
unregisterIdNameCacheFromDocument(document());
- // HTMLNameCollection, ClassCollection and TagCollection remove cache by themselves.
- if (type() != WindowNamedItems && type() != DocumentNamedItems && type() != ClassCollectionType
- && type() != HTMLTagCollectionType && type() != TagCollectionType) {
+ // Named HTMLCollection types remove cache by themselves.
+ if (isUnnamedHTMLCollectionType(type()))
ownerNode().nodeLists()->removeCache(this, type());
- }
}
void HTMLCollection::invalidateCache(Document* oldDocument) const
« Source/core/html/CollectionType.h ('K') | « Source/core/html/CollectionType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698