Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / webidl / Node.webidl
blob8fdc21b2a397a017f7e2daece7b95000166f3d18
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  */
13 interface Principal;
14 interface URI;
16 [Exposed=Window]
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;
35   [Pure, Throws, NeedsCallerType, BinaryName="baseURIFromJS"]
36   readonly attribute DOMString? baseURI;
38   [Pure, BinaryName=isInComposedDoc]
39   readonly attribute boolean isConnected;
40   [Pure]
41   readonly attribute Document? ownerDocument;
42   [Pure]
43   Node getRootNode(optional GetRootNodeOptions options = {});
44   [Pure]
45   readonly attribute Node? parentNode;
46   [Pure]
47   readonly attribute Element? parentElement;
48   [Pure]
49   boolean hasChildNodes();
50   [SameObject]
51   readonly attribute NodeList childNodes;
52   [Pure]
53   readonly attribute Node? firstChild;
54   [Pure]
55   readonly attribute Node? lastChild;
56   [Pure]
57   readonly attribute Node? previousSibling;
58   [Pure]
59   readonly attribute Node? nextSibling;
61   [CEReactions, SetterThrows, Pure]
62            attribute DOMString? nodeValue;
63   [CEReactions, SetterThrows, GetterCanOOM,
64    SetterNeedsSubjectPrincipal=NonSystem, Pure]
65            attribute DOMString? textContent;
66   // These DOM methods cannot be accessed by UA Widget scripts
67   // because the DOM element reflectors will be in the content scope,
68   // instead of the desired UA Widget scope.
69   [CEReactions, Throws, Func="IsNotUAWidget"]
70   Node insertBefore(Node node, Node? child);
71   [CEReactions, Throws, Func="IsNotUAWidget"]
72   Node appendChild(Node node);
73   [CEReactions, Throws, Func="IsNotUAWidget"]
74   Node replaceChild(Node node, Node child);
75   [CEReactions, Throws]
76   Node removeChild(Node child);
77   [CEReactions]
78   void normalize();
80   [CEReactions, Throws, Func="IsNotUAWidget"]
81   Node cloneNode(optional boolean deep = false);
82   [Pure]
83   boolean isSameNode(Node? node);
84   [Pure]
85   boolean isEqualNode(Node? node);
87   const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
88   const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
89   const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
90   const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
91   const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
92   const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
93   [Pure]
94   unsigned short compareDocumentPosition(Node other);
95   [Pure]
96   boolean contains(Node? other);
98   [Pure]
99   DOMString? lookupPrefix(DOMString? namespace);
100   [Pure]
101   DOMString? lookupNamespaceURI(DOMString? prefix);
102   [Pure]
103   boolean isDefaultNamespace(DOMString? namespace);
105   // Mozilla-specific stuff
106   [ChromeOnly]
107   readonly attribute Principal nodePrincipal;
108   [ChromeOnly]
109   readonly attribute URI? baseURIObject;
110   [ChromeOnly]
111   DOMString generateXPath();
112   [ChromeOnly, Pure, BinaryName="flattenedTreeParentNodeNonInline"]
113   readonly attribute Node? flattenedTreeParentNode;
114   [ChromeOnly, Pure, BinaryName="containingShadow"]
115   readonly attribute ShadowRoot? containingShadowRoot;
116   [ChromeOnly, Pure, BinaryName="isInNativeAnonymousSubtree"]
117   readonly attribute boolean isNativeAnonymous;
119   // Mozilla devtools-specific stuff
120   /**
121    * If this element is a flex item (or has one or more anonymous box ancestors
122    * that chain up to an anonymous flex item), then this method returns the
123    * flex container that the flex item participates in. Otherwise, this method
124    * returns null.
125    */
126   [ChromeOnly]
127   readonly attribute Element? parentFlexElement;
129 #ifdef ACCESSIBILITY
130   [Func="mozilla::dom::AccessibleNode::IsAOMEnabled", SameObject]
131   readonly attribute AccessibleNode? accessibleNode;
132 #endif
135 dictionary GetRootNodeOptions {
136   boolean composed = false;