|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 * |
|
6 * The origin of this IDL file is |
|
7 * http://www.w3.org/TR/2012/WD-dom-20120105/ |
|
8 * |
|
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C |
|
10 * liability, trademark and document use rules apply. |
|
11 */ |
|
12 |
|
13 interface Principal; |
|
14 interface URI; |
|
15 interface UserDataHandler; |
|
16 |
|
17 interface Node : EventTarget { |
|
18 const unsigned short ELEMENT_NODE = 1; |
|
19 const unsigned short ATTRIBUTE_NODE = 2; // historical |
|
20 const unsigned short TEXT_NODE = 3; |
|
21 const unsigned short CDATA_SECTION_NODE = 4; // historical |
|
22 const unsigned short ENTITY_REFERENCE_NODE = 5; // historical |
|
23 const unsigned short ENTITY_NODE = 6; // historical |
|
24 const unsigned short PROCESSING_INSTRUCTION_NODE = 7; |
|
25 const unsigned short COMMENT_NODE = 8; |
|
26 const unsigned short DOCUMENT_NODE = 9; |
|
27 const unsigned short DOCUMENT_TYPE_NODE = 10; |
|
28 const unsigned short DOCUMENT_FRAGMENT_NODE = 11; |
|
29 const unsigned short NOTATION_NODE = 12; // historical |
|
30 [Constant] |
|
31 readonly attribute unsigned short nodeType; |
|
32 [Pure] |
|
33 readonly attribute DOMString nodeName; |
|
34 |
|
35 [Pure] |
|
36 readonly attribute DOMString? baseURI; |
|
37 |
|
38 [Pure] |
|
39 readonly attribute Document? ownerDocument; |
|
40 [Pure] |
|
41 readonly attribute Node? parentNode; |
|
42 [Pure] |
|
43 readonly attribute Element? parentElement; |
|
44 [Pure] |
|
45 boolean hasChildNodes(); |
|
46 [SameObject] |
|
47 readonly attribute NodeList childNodes; |
|
48 [Pure] |
|
49 readonly attribute Node? firstChild; |
|
50 [Pure] |
|
51 readonly attribute Node? lastChild; |
|
52 [Pure] |
|
53 readonly attribute Node? previousSibling; |
|
54 [Pure] |
|
55 readonly attribute Node? nextSibling; |
|
56 |
|
57 [SetterThrows, Pure] |
|
58 attribute DOMString? nodeValue; |
|
59 [SetterThrows, Pure] |
|
60 attribute DOMString? textContent; |
|
61 [Throws] |
|
62 Node insertBefore(Node node, Node? child); |
|
63 [Throws] |
|
64 Node appendChild(Node node); |
|
65 [Throws] |
|
66 Node replaceChild(Node node, Node child); |
|
67 [Throws] |
|
68 Node removeChild(Node child); |
|
69 void normalize(); |
|
70 |
|
71 [Throws] |
|
72 Node cloneNode(optional boolean deep = false); |
|
73 [Pure] |
|
74 boolean isEqualNode(Node? node); |
|
75 |
|
76 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; |
|
77 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; |
|
78 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; |
|
79 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; |
|
80 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; |
|
81 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical |
|
82 [Pure] |
|
83 unsigned short compareDocumentPosition(Node other); |
|
84 [Pure] |
|
85 boolean contains(Node? other); |
|
86 |
|
87 [Pure] |
|
88 DOMString? lookupPrefix(DOMString? namespace); |
|
89 [Pure] |
|
90 DOMString? lookupNamespaceURI(DOMString? prefix); |
|
91 [Pure] |
|
92 boolean isDefaultNamespace(DOMString? namespace); |
|
93 |
|
94 // Mozilla-specific stuff |
|
95 // These have been moved to Element in the spec. |
|
96 // If we move namespaceURI, prefix and localName to Element they should return |
|
97 // a non-nullable type. |
|
98 [Constant] |
|
99 readonly attribute DOMString? namespaceURI; |
|
100 [Constant] |
|
101 readonly attribute DOMString? prefix; |
|
102 [Constant] |
|
103 readonly attribute DOMString? localName; |
|
104 |
|
105 [Pure] |
|
106 boolean hasAttributes(); |
|
107 [Throws, Func="IsChromeOrXBL"] |
|
108 any setUserData(DOMString key, any data, UserDataHandler? handler); |
|
109 [Throws, Func="IsChromeOrXBL"] |
|
110 any getUserData(DOMString key); |
|
111 [ChromeOnly] |
|
112 readonly attribute Principal nodePrincipal; |
|
113 [ChromeOnly] |
|
114 readonly attribute URI? baseURIObject; |
|
115 [ChromeOnly] |
|
116 sequence<MutationObserver> getBoundMutationObservers(); |
|
117 }; |