# lib/goog/dom/nodetype.js

1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS-IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | /**
16 | * @fileoverview Definition of goog.dom.NodeType.
17 | */
18 |
19 | goog.provide('goog.dom.NodeType');
20 |
21 |
22 | /**
23 | * Constants for the nodeType attribute in the Node interface.
24 | *
25 | * These constants match those specified in the Node interface. These are
26 | * usually present on the Node object in recent browsers, but not in older
27 | * browsers (specifically, early IEs) and thus are given here.
28 | *
29 | * In some browsers (early IEs), these are not defined on the Node object,
30 | * so they are provided here.
31 | *
32 | * See http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247
33 | * @enum {number}
34 | */
35 | goog.dom.NodeType = {
36 | ELEMENT: 1,
37 | ATTRIBUTE: 2,
38 | TEXT: 3,
39 | CDATA_SECTION: 4,
40 | ENTITY_REFERENCE: 5,
41 | ENTITY: 6,
42 | PROCESSING_INSTRUCTION: 7,
43 | COMMENT: 8,
44 | DOCUMENT: 9,
45 | DOCUMENT_TYPE: 10,
46 | DOCUMENT_FRAGMENT: 11,
47 | NOTATION: 12
48 | };