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

Unified Diff: Source/core/html/CollectionType.h

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
« no previous file with comments | « no previous file | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/CollectionType.h
diff --git a/Source/core/html/CollectionType.h b/Source/core/html/CollectionType.h
index 4e53682b6740e940ee612f93107babf73e971b3e..db7d302b992cf91477c30dc54da90192dca7ebbb 100644
--- a/Source/core/html/CollectionType.h
+++ b/Source/core/html/CollectionType.h
@@ -36,10 +36,6 @@ enum CollectionType {
DocScripts, // all <script> elements
DocAll, // "all" elements (IE)
- // Named collection types cached in the document.
- WindowNamedItems,
- DocumentNamedItems,
-
// Unnamed HTMLCollection types cached in elements.
NodeChildren, // first-level children (ParentNode DOM interface)
TableTBodies, // all <tbody> elements in this table
@@ -52,6 +48,11 @@ enum CollectionType {
MapAreas,
FormControls,
+ // Named HTMLCollection types cached in the document.
+ WindowNamedItems,
+ DocumentNamedItems,
+
+ // Named HTMLCollection types cached in elements.
ClassCollectionType,
TagCollectionType,
HTMLTagCollectionType,
@@ -63,8 +64,14 @@ enum CollectionType {
LabelsNodeListType,
};
+static const CollectionType FirstNamedCollectionType = WindowNamedItems;
static const CollectionType FirstLiveNodeListType = NameNodeListType;
adamk 2014/04/17 18:08:08 Not sure why these aren't just members of the enum
+inline bool isUnnamedHTMLCollectionType(CollectionType type)
+{
+ return type < FirstNamedCollectionType;
+}
+
inline bool isLiveNodeListType(CollectionType type)
{
return type >= FirstLiveNodeListType;
« no previous file with comments | « no previous file | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698