• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4  * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef CollectionType_h
24 #define CollectionType_h
25 
26 namespace blink {
27 
28 enum CollectionType {
29     // Unnamed HTMLCollection types cached in the document.
30     DocImages,    // all <img> elements in the document
31     DocApplets,   // all <object> and <applet> elements
32     DocEmbeds,    // all <embed> elements
33     DocForms,     // all <form> elements
34     DocLinks,     // all <a> _and_ <area> elements with a value for href
35     DocAnchors,   // all <a> elements with a value for name
36     DocScripts,   // all <script> elements
37     DocAll,       // "all" elements (IE)
38 
39     // Unnamed HTMLCollection types cached in elements.
40     NodeChildren, // first-level children (ParentNode DOM interface)
41     TableTBodies, // all <tbody> elements in this table
42     TSectionRows, // all row elements in this table section
43     TableRows,
44     TRCells,      // all cells in this row
45     SelectOptions,
46     SelectedOptions,
47     DataListOptions,
48     MapAreas,
49     FormControls,
50 
51     // Named HTMLCollection types cached in the document.
52     WindowNamedItems,
53     DocumentNamedItems,
54 
55     // Named HTMLCollection types cached in elements.
56     ClassCollectionType,
57     TagCollectionType,
58     HTMLTagCollectionType,
59 
60     // Live NodeList.
61     NameNodeListType,
62     RadioNodeListType,
63     RadioImgNodeListType,
64     LabelsNodeListType,
65 };
66 
67 static const CollectionType FirstNamedCollectionType = WindowNamedItems;
68 static const CollectionType FirstLiveNodeListType = NameNodeListType;
69 
isUnnamedHTMLCollectionType(CollectionType type)70 inline bool isUnnamedHTMLCollectionType(CollectionType type)
71 {
72     return type < FirstNamedCollectionType;
73 }
74 
isHTMLCollectionType(CollectionType type)75 inline bool isHTMLCollectionType(CollectionType type)
76 {
77     return type < FirstLiveNodeListType;
78 }
79 
isLiveNodeListType(CollectionType type)80 inline bool isLiveNodeListType(CollectionType type)
81 {
82     return type >= FirstLiveNodeListType;
83 }
84 
85 } // namespace
86 
87 #endif
88