|
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 |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "domstubs.idl" |
|
7 |
|
8 interface nsIVariant; |
|
9 interface nsIDOMUserDataHandler; |
|
10 |
|
11 /** |
|
12 * The nsIDOMNode interface is the primary datatype for the entire |
|
13 * Document Object Model. |
|
14 * It represents a single node in the document tree. |
|
15 * |
|
16 * For more information on this interface please see |
|
17 * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html |
|
18 */ |
|
19 |
|
20 [scriptable, uuid(56545150-a001-484e-9ed4-cb319eebd7b3)] |
|
21 interface nsIDOMNode : nsISupports |
|
22 { |
|
23 const unsigned short ELEMENT_NODE = 1; |
|
24 const unsigned short ATTRIBUTE_NODE = 2; |
|
25 const unsigned short TEXT_NODE = 3; |
|
26 const unsigned short CDATA_SECTION_NODE = 4; |
|
27 const unsigned short ENTITY_REFERENCE_NODE = 5; |
|
28 const unsigned short ENTITY_NODE = 6; |
|
29 const unsigned short PROCESSING_INSTRUCTION_NODE = 7; |
|
30 const unsigned short COMMENT_NODE = 8; |
|
31 const unsigned short DOCUMENT_NODE = 9; |
|
32 const unsigned short DOCUMENT_TYPE_NODE = 10; |
|
33 const unsigned short DOCUMENT_FRAGMENT_NODE = 11; |
|
34 const unsigned short NOTATION_NODE = 12; |
|
35 |
|
36 readonly attribute DOMString nodeName; |
|
37 attribute DOMString nodeValue; |
|
38 // raises(DOMException) on setting |
|
39 // raises(DOMException) on retrieval |
|
40 readonly attribute unsigned short nodeType; |
|
41 readonly attribute nsIDOMNode parentNode; |
|
42 readonly attribute nsIDOMElement parentElement; |
|
43 readonly attribute nsIDOMNodeList childNodes; |
|
44 readonly attribute nsIDOMNode firstChild; |
|
45 readonly attribute nsIDOMNode lastChild; |
|
46 readonly attribute nsIDOMNode previousSibling; |
|
47 readonly attribute nsIDOMNode nextSibling; |
|
48 // Modified in DOM Level 2: |
|
49 readonly attribute nsIDOMDocument ownerDocument; |
|
50 nsIDOMNode insertBefore(in nsIDOMNode newChild, |
|
51 in nsIDOMNode refChild) |
|
52 raises(DOMException); |
|
53 nsIDOMNode replaceChild(in nsIDOMNode newChild, |
|
54 in nsIDOMNode oldChild) |
|
55 raises(DOMException); |
|
56 nsIDOMNode removeChild(in nsIDOMNode oldChild) |
|
57 raises(DOMException); |
|
58 nsIDOMNode appendChild(in nsIDOMNode newChild) |
|
59 raises(DOMException); |
|
60 boolean hasChildNodes(); |
|
61 // Modified in DOM Level 4: |
|
62 [optional_argc] nsIDOMNode cloneNode([optional] in boolean deep); |
|
63 // Modified in DOM Level 2: |
|
64 void normalize(); |
|
65 // Introduced in DOM Level 2: |
|
66 readonly attribute DOMString namespaceURI; |
|
67 // Modified in DOM Core |
|
68 readonly attribute DOMString prefix; |
|
69 |
|
70 // Introduced in DOM Level 2: |
|
71 readonly attribute DOMString localName; |
|
72 // Introduced in DOM Level 2: |
|
73 boolean hasAttributes(); |
|
74 |
|
75 // Introduced in DOM Level 3: |
|
76 // This uses a binaryname to avoid warnings due to name collision with |
|
77 // nsINode::GetBaseURI |
|
78 [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI; |
|
79 |
|
80 // DocumentPosition |
|
81 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; |
|
82 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; |
|
83 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; |
|
84 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; |
|
85 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; |
|
86 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; |
|
87 |
|
88 // Introduced in DOM Level 3: |
|
89 unsigned short compareDocumentPosition(in nsIDOMNode other) |
|
90 raises(DOMException); |
|
91 // Introduced in DOM Level 3: |
|
92 attribute DOMString textContent; |
|
93 // raises(DOMException) on setting |
|
94 // raises(DOMException) on retrieval |
|
95 |
|
96 // Introduced in DOM Level 3: |
|
97 DOMString lookupPrefix(in DOMString namespaceURI); |
|
98 // Introduced in DOM Level 3: |
|
99 boolean isDefaultNamespace(in DOMString namespaceURI); |
|
100 // Introduced in DOM Level 3: |
|
101 DOMString lookupNamespaceURI(in DOMString prefix); |
|
102 // Introduced in DOM Level 3: |
|
103 boolean isEqualNode(in nsIDOMNode arg); |
|
104 // Introduced in DOM Level 3: |
|
105 nsIVariant setUserData(in DOMString key, |
|
106 in nsIVariant data, |
|
107 in nsIDOMUserDataHandler handler); |
|
108 // Introduced in DOM Level 3: |
|
109 nsIVariant getUserData(in DOMString key); |
|
110 |
|
111 boolean contains(in nsIDOMNode aOther); |
|
112 }; |