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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 18 matching lines...) Expand all
29 // Unnamed HTMLCollection types cached in the document. 29 // Unnamed HTMLCollection types cached in the document.
30 DocImages, // all <img> elements in the document 30 DocImages, // all <img> elements in the document
31 DocApplets, // all <object> and <applet> elements 31 DocApplets, // all <object> and <applet> elements
32 DocEmbeds, // all <embed> elements 32 DocEmbeds, // all <embed> elements
33 DocForms, // all <form> elements 33 DocForms, // all <form> elements
34 DocLinks, // all <a> _and_ <area> elements with a value for href 34 DocLinks, // all <a> _and_ <area> elements with a value for href
35 DocAnchors, // all <a> elements with a value for name 35 DocAnchors, // all <a> elements with a value for name
36 DocScripts, // all <script> elements 36 DocScripts, // all <script> elements
37 DocAll, // "all" elements (IE) 37 DocAll, // "all" elements (IE)
38 38
39 // Named collection types cached in the document.
40 WindowNamedItems,
41 DocumentNamedItems,
42
43 // Unnamed HTMLCollection types cached in elements. 39 // Unnamed HTMLCollection types cached in elements.
44 NodeChildren, // first-level children (ParentNode DOM interface) 40 NodeChildren, // first-level children (ParentNode DOM interface)
45 TableTBodies, // all <tbody> elements in this table 41 TableTBodies, // all <tbody> elements in this table
46 TSectionRows, // all row elements in this table section 42 TSectionRows, // all row elements in this table section
47 TableRows, 43 TableRows,
48 TRCells, // all cells in this row 44 TRCells, // all cells in this row
49 SelectOptions, 45 SelectOptions,
50 SelectedOptions, 46 SelectedOptions,
51 DataListOptions, 47 DataListOptions,
52 MapAreas, 48 MapAreas,
53 FormControls, 49 FormControls,
54 50
51 // Named HTMLCollection types cached in the document.
52 WindowNamedItems,
53 DocumentNamedItems,
54
55 // Named HTMLCollection types cached in elements.
55 ClassCollectionType, 56 ClassCollectionType,
56 TagCollectionType, 57 TagCollectionType,
57 HTMLTagCollectionType, 58 HTMLTagCollectionType,
58 59
59 // Live NodeList. 60 // Live NodeList.
60 NameNodeListType, 61 NameNodeListType,
61 RadioNodeListType, 62 RadioNodeListType,
62 RadioImgNodeListType, 63 RadioImgNodeListType,
63 LabelsNodeListType, 64 LabelsNodeListType,
64 }; 65 };
65 66
67 static const CollectionType FirstNamedCollectionType = WindowNamedItems;
66 static const CollectionType FirstLiveNodeListType = NameNodeListType; 68 static const CollectionType FirstLiveNodeListType = NameNodeListType;
adamk 2014/04/17 18:08:08 Not sure why these aren't just members of the enum
67 69
70 inline bool isUnnamedHTMLCollectionType(CollectionType type)
71 {
72 return type < FirstNamedCollectionType;
73 }
74
68 inline bool isLiveNodeListType(CollectionType type) 75 inline bool isLiveNodeListType(CollectionType type)
69 { 76 {
70 return type >= FirstLiveNodeListType; 77 return type >= FirstLiveNodeListType;
71 } 78 }
72 79
73 } // namespace 80 } // namespace
74 81
75 #endif 82 #endif
OLDNEW
« 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