OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
3 <title>DOM IDL tests</title> | 3 <title>DOM IDL tests</title> |
4 <script src=../../../resources/testharness.js></script> | 4 <script src=../../../resources/testharness.js></script> |
5 <script src=../../../resources/testharnessreport.js></script> | 5 <script src=../../../resources/testharnessreport.js></script> |
6 <script src=../../../resources/WebIDLParser.js></script> | 6 <script src=../../../resources/WebIDLParser.js></script> |
7 <script src=../../../resources/idlharness.js></script> | 7 <script src=../../../resources/idlharness.js></script> |
8 | 8 |
9 <h1>DOM IDL tests</h1> | 9 <h1>DOM IDL tests</h1> |
10 <div id=log></div> | 10 <div id=log></div> |
(...skipping 24 matching lines...) Expand all Loading... |
35 readonly attribute DOMTimeStamp timeStamp; | 35 readonly attribute DOMTimeStamp timeStamp; |
36 | 36 |
37 void initEvent(DOMString type, boolean bubbles, boolean cancelable); | 37 void initEvent(DOMString type, boolean bubbles, boolean cancelable); |
38 }; | 38 }; |
39 | 39 |
40 dictionary EventInit { | 40 dictionary EventInit { |
41 boolean bubbles = false; | 41 boolean bubbles = false; |
42 boolean cancelable = false; | 42 boolean cancelable = false; |
43 }; | 43 }; |
44 | 44 |
| 45 |
45 [Constructor(DOMString type, optional CustomEventInit eventInitDict)/*, | 46 [Constructor(DOMString type, optional CustomEventInit eventInitDict)/*, |
46 Exposed=(Window,Worker)*/] | 47 Exposed=(Window,Worker)*/] |
47 interface CustomEvent : Event { | 48 interface CustomEvent : Event { |
48 readonly attribute any detail; | 49 readonly attribute any detail; |
49 | 50 |
50 void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any
detail); | 51 void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any
detail); |
51 }; | 52 }; |
52 | 53 |
53 dictionary CustomEventInit : EventInit { | 54 dictionary CustomEventInit : EventInit { |
54 any detail = null; | 55 any detail = null; |
55 }; | 56 }; |
56 | 57 |
| 58 |
57 //[Exposed=(Window,Worker)] | 59 //[Exposed=(Window,Worker)] |
58 interface EventTarget { | 60 interface EventTarget { |
59 void addEventListener(DOMString type, EventListener? callback, optional boolea
n capture = false); | 61 void addEventListener(DOMString type, EventListener? callback, optional (Event
ListenerOptions or boolean) options); |
60 void removeEventListener(DOMString type, EventListener? callback, optional boo
lean capture = false); | 62 void removeEventListener(DOMString type, EventListener? callback, optional (Ev
entListenerOptions or boolean) options); |
61 boolean dispatchEvent(Event event); | 63 boolean dispatchEvent(Event event); |
62 }; | 64 }; |
63 | 65 |
64 callback interface EventListener { | 66 callback interface EventListener { |
65 void handleEvent(Event event); | 67 void handleEvent(Event event); |
66 }; | 68 }; |
67 | 69 |
68 [NoInterfaceObject] | 70 dictionary EventListenerOptions { |
| 71 boolean capture; |
| 72 boolean passive; |
| 73 }; |
| 74 |
| 75 |
| 76 [NoInterfaceObject, |
| 77 Exposed=Window] |
69 interface NonElementParentNode { | 78 interface NonElementParentNode { |
70 Element? getElementById(DOMString elementId); | 79 Element? getElementById(DOMString elementId); |
71 }; | 80 }; |
72 Document implements NonElementParentNode; | 81 Document implements NonElementParentNode; |
73 DocumentFragment implements NonElementParentNode; | 82 DocumentFragment implements NonElementParentNode; |
74 | 83 |
75 [NoInterfaceObject] | 84 |
| 85 [NoInterfaceObject, |
| 86 Exposed=Window] |
| 87 interface DocumentOrShadowRoot { |
| 88 }; |
| 89 Document implements DocumentOrShadowRoot; |
| 90 ShadowRoot implements DocumentOrShadowRoot; |
| 91 |
| 92 |
| 93 [NoInterfaceObject, |
| 94 Exposed=Window] |
76 interface ParentNode { | 95 interface ParentNode { |
77 [SameObject] readonly attribute HTMLCollection children; | 96 [SameObject] readonly attribute HTMLCollection children; |
78 readonly attribute Element? firstElementChild; | 97 readonly attribute Element? firstElementChild; |
79 readonly attribute Element? lastElementChild; | 98 readonly attribute Element? lastElementChild; |
80 readonly attribute unsigned long childElementCount; | 99 readonly attribute unsigned long childElementCount; |
81 | 100 |
82 [Unscopeable] void prepend((Node or DOMString)... nodes); | 101 [Unscopable] void prepend((Node or DOMString)... nodes); |
83 [Unscopeable] void append((Node or DOMString)... nodes); | 102 [Unscopable] void append((Node or DOMString)... nodes); |
84 | 103 |
85 [Unscopeable] Element? query(DOMString relativeSelectors); | |
86 [NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors); | |
87 Element? querySelector(DOMString selectors); | 104 Element? querySelector(DOMString selectors); |
88 [NewObject] NodeList querySelectorAll(DOMString selectors); | 105 [NewObject] NodeList querySelectorAll(DOMString selectors); |
89 }; | 106 }; |
90 Document implements ParentNode; | 107 Document implements ParentNode; |
91 DocumentFragment implements ParentNode; | 108 DocumentFragment implements ParentNode; |
92 Element implements ParentNode; | 109 Element implements ParentNode; |
93 | 110 |
94 [NoInterfaceObject] | 111 |
| 112 [NoInterfaceObject, |
| 113 Exposed=Window] |
95 interface NonDocumentTypeChildNode { | 114 interface NonDocumentTypeChildNode { |
96 readonly attribute Element? previousElementSibling; | 115 readonly attribute Element? previousElementSibling; |
97 readonly attribute Element? nextElementSibling; | 116 readonly attribute Element? nextElementSibling; |
98 }; | 117 }; |
99 Element implements NonDocumentTypeChildNode; | 118 Element implements NonDocumentTypeChildNode; |
100 CharacterData implements NonDocumentTypeChildNode; | 119 CharacterData implements NonDocumentTypeChildNode; |
101 | 120 |
102 [NoInterfaceObject] | 121 |
| 122 [NoInterfaceObject, |
| 123 Exposed=Window] |
103 interface ChildNode { | 124 interface ChildNode { |
104 [Unscopeable] void before((Node or DOMString)... nodes); | 125 [Unscopable] void before((Node or DOMString)... nodes); |
105 [Unscopeable] void after((Node or DOMString)... nodes); | 126 [Unscopable] void after((Node or DOMString)... nodes); |
106 [Unscopeable] void replaceWith((Node or DOMString)... nodes); | 127 [Unscopable] void replaceWith((Node or DOMString)... nodes); |
107 [Unscopeable] void remove(); | 128 [Unscopable] void remove(); |
108 }; | 129 }; |
109 DocumentType implements ChildNode; | 130 DocumentType implements ChildNode; |
110 Element implements ChildNode; | 131 Element implements ChildNode; |
111 CharacterData implements ChildNode; | 132 CharacterData implements ChildNode; |
112 | 133 |
113 // XXX unrecognized tokens "class", "extends" | |
114 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20020 | |
115 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23225 | |
116 //class Elements extends Array { | |
117 // Element? query(DOMString relativeSelectors); | |
118 // Elements queryAll(DOMString relativeSelectors); | |
119 //}; | |
120 | 134 |
| 135 [NoInterfaceObject, |
| 136 Exposed=Window] |
| 137 interface Slotable { |
| 138 readonly attribute HTMLSlotElement? assignedSlot; |
| 139 }; |
| 140 Element implements Slotable; |
| 141 Text implements Slotable; |
| 142 |
| 143 |
| 144 [Exposed=Window] |
121 interface NodeList { | 145 interface NodeList { |
122 getter Node? item(unsigned long index); | 146 getter Node? item(unsigned long index); |
123 readonly attribute unsigned long length; | 147 readonly attribute unsigned long length; |
124 // iterable<Node>; | 148 // iterable<Node>; |
125 }; | 149 }; |
126 | 150 |
| 151 |
| 152 [Exposed=Window, LegacyUnenumerableNamedProperties] |
127 interface HTMLCollection { | 153 interface HTMLCollection { |
128 readonly attribute unsigned long length; | 154 readonly attribute unsigned long length; |
129 getter Element? item(unsigned long index); | 155 getter Element? item(unsigned long index); |
130 getter Element? namedItem(DOMString name); | 156 getter Element? namedItem(DOMString name); |
131 }; | 157 }; |
132 | 158 |
| 159 |
133 [Constructor(MutationCallback callback)] | 160 [Constructor(MutationCallback callback)] |
134 interface MutationObserver { | 161 interface MutationObserver { |
135 void observe(Node target, MutationObserverInit options); | 162 void observe(Node target, MutationObserverInit options); |
136 void disconnect(); | 163 void disconnect(); |
137 sequence<MutationRecord> takeRecords(); | 164 sequence<MutationRecord> takeRecords(); |
138 }; | 165 }; |
139 | 166 |
140 callback MutationCallback = void (sequence<MutationRecord> mutations, MutationOb
server observer); | 167 callback MutationCallback = void (sequence<MutationRecord> mutations, MutationOb
server observer); |
141 | 168 |
142 dictionary MutationObserverInit { | 169 dictionary MutationObserverInit { |
143 boolean childList = false; | 170 boolean childList = false; |
144 boolean attributes; | 171 boolean attributes; |
145 boolean characterData; | 172 boolean characterData; |
146 boolean subtree = false; | 173 boolean subtree = false; |
147 boolean attributeOldValue; | 174 boolean attributeOldValue; |
148 boolean characterDataOldValue; | 175 boolean characterDataOldValue; |
149 sequence<DOMString> attributeFilter; | 176 sequence<DOMString> attributeFilter; |
150 }; | 177 }; |
151 | 178 |
| 179 |
| 180 [Exposed=Window] |
152 interface MutationRecord { | 181 interface MutationRecord { |
153 readonly attribute DOMString type; | 182 readonly attribute DOMString type; |
154 readonly attribute Node target; | 183 [SameObject] readonly attribute Node target; |
155 [SameObject] readonly attribute NodeList addedNodes; | 184 [SameObject] readonly attribute NodeList addedNodes; |
156 [SameObject] readonly attribute NodeList removedNodes; | 185 [SameObject] readonly attribute NodeList removedNodes; |
157 readonly attribute Node? previousSibling; | 186 readonly attribute Node? previousSibling; |
158 readonly attribute Node? nextSibling; | 187 readonly attribute Node? nextSibling; |
159 readonly attribute DOMString? attributeName; | 188 readonly attribute DOMString? attributeName; |
160 readonly attribute DOMString? attributeNamespace; | 189 readonly attribute DOMString? attributeNamespace; |
161 readonly attribute DOMString? oldValue; | 190 readonly attribute DOMString? oldValue; |
162 }; | 191 }; |
163 | 192 |
| 193 |
| 194 [Exposed=Window] |
164 interface Node : EventTarget { | 195 interface Node : EventTarget { |
165 const unsigned short ELEMENT_NODE = 1; | 196 const unsigned short ELEMENT_NODE = 1; |
166 const unsigned short ATTRIBUTE_NODE = 2; // historical | 197 const unsigned short ATTRIBUTE_NODE = 2; // historical |
167 const unsigned short TEXT_NODE = 3; | 198 const unsigned short TEXT_NODE = 3; |
168 const unsigned short CDATA_SECTION_NODE = 4; // historical | 199 const unsigned short CDATA_SECTION_NODE = 4; // historical |
169 const unsigned short ENTITY_REFERENCE_NODE = 5; // historical | 200 const unsigned short ENTITY_REFERENCE_NODE = 5; // historical |
170 const unsigned short ENTITY_NODE = 6; // historical | 201 const unsigned short ENTITY_NODE = 6; // historical |
171 const unsigned short PROCESSING_INSTRUCTION_NODE = 7; | 202 const unsigned short PROCESSING_INSTRUCTION_NODE = 7; |
172 const unsigned short COMMENT_NODE = 8; | 203 const unsigned short COMMENT_NODE = 8; |
173 const unsigned short DOCUMENT_NODE = 9; | 204 const unsigned short DOCUMENT_NODE = 9; |
174 const unsigned short DOCUMENT_TYPE_NODE = 10; | 205 const unsigned short DOCUMENT_TYPE_NODE = 10; |
175 const unsigned short DOCUMENT_FRAGMENT_NODE = 11; | 206 const unsigned short DOCUMENT_FRAGMENT_NODE = 11; |
176 const unsigned short NOTATION_NODE = 12; // historical | 207 const unsigned short NOTATION_NODE = 12; // historical |
177 readonly attribute unsigned short nodeType; | 208 readonly attribute unsigned short nodeType; |
178 readonly attribute DOMString nodeName; | 209 readonly attribute DOMString nodeName; |
179 | 210 |
180 readonly attribute DOMString? baseURI; | 211 readonly attribute DOMString baseURI; |
181 | 212 |
| 213 readonly attribute boolean isConnected; |
182 readonly attribute Document? ownerDocument; | 214 readonly attribute Document? ownerDocument; |
183 readonly attribute Node rootNode; | 215 readonly attribute Node rootNode; |
184 readonly attribute Node? parentNode; | 216 readonly attribute Node? parentNode; |
185 readonly attribute Element? parentElement; | 217 readonly attribute Element? parentElement; |
186 boolean hasChildNodes(); | 218 boolean hasChildNodes(); |
187 [SameObject] readonly attribute NodeList childNodes; | 219 [SameObject] readonly attribute NodeList childNodes; |
188 readonly attribute Node? firstChild; | 220 readonly attribute Node? firstChild; |
189 readonly attribute Node? lastChild; | 221 readonly attribute Node? lastChild; |
190 readonly attribute Node? previousSibling; | 222 readonly attribute Node? previousSibling; |
191 readonly attribute Node? nextSibling; | 223 readonly attribute Node? nextSibling; |
192 | 224 |
193 attribute DOMString? nodeValue; | 225 attribute DOMString? nodeValue; |
194 attribute DOMString? textContent; | 226 attribute DOMString? textContent; |
195 void normalize(); | 227 void normalize(); |
196 | 228 |
197 [NewObject] Node cloneNode(optional boolean deep = false); | 229 [NewObject] Node cloneNode(optional boolean deep = false); |
198 boolean isEqualNode(Node? node); | 230 boolean isEqualNode(Node? otherNode); |
| 231 boolean isSameNode(Node? otherNode); // historical alias of === |
199 | 232 |
200 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; | 233 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; |
201 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; | 234 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; |
202 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; | 235 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; |
203 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; | 236 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; |
204 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; | 237 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; |
205 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; | 238 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; |
206 unsigned short compareDocumentPosition(Node other); | 239 unsigned short compareDocumentPosition(Node other); |
207 boolean contains(Node? other); | 240 boolean contains(Node? other); |
208 | 241 |
209 DOMString? lookupPrefix(DOMString? namespace); | 242 DOMString? lookupPrefix(DOMString? namespace); |
210 DOMString? lookupNamespaceURI(DOMString? prefix); | 243 DOMString? lookupNamespaceURI(DOMString? prefix); |
211 boolean isDefaultNamespace(DOMString? namespace); | 244 boolean isDefaultNamespace(DOMString? namespace); |
212 | 245 |
213 Node insertBefore(Node node, Node? child); | 246 Node insertBefore(Node node, Node? child); |
214 Node appendChild(Node node); | 247 Node appendChild(Node node); |
215 Node replaceChild(Node node, Node child); | 248 Node replaceChild(Node node, Node child); |
216 Node removeChild(Node child); | 249 Node removeChild(Node child); |
217 }; | 250 }; |
218 | 251 |
219 [Constructor] | 252 |
| 253 [Constructor, |
| 254 Exposed=Window] |
220 interface Document : Node { | 255 interface Document : Node { |
221 [SameObject] readonly attribute DOMImplementation implementation; | 256 [SameObject] readonly attribute DOMImplementation implementation; |
222 readonly attribute DOMString URL; | 257 readonly attribute DOMString URL; |
223 readonly attribute DOMString documentURI; | 258 readonly attribute DOMString documentURI; |
224 readonly attribute DOMString origin; | 259 readonly attribute DOMString origin; |
225 readonly attribute DOMString compatMode; | 260 readonly attribute DOMString compatMode; |
226 readonly attribute DOMString characterSet; | 261 readonly attribute DOMString characterSet; |
227 readonly attribute DOMString charset; // legacy alias of .characterSet | 262 readonly attribute DOMString charset; // historical alias of .characterSet |
228 readonly attribute DOMString inputEncoding; // legacy alias of .characterSet | 263 readonly attribute DOMString inputEncoding; // historical alias of .characterS
et |
229 readonly attribute DOMString contentType; | 264 readonly attribute DOMString contentType; |
230 | 265 |
231 readonly attribute DocumentType? doctype; | 266 readonly attribute DocumentType? doctype; |
232 readonly attribute Element? documentElement; | 267 readonly attribute Element? documentElement; |
233 HTMLCollection getElementsByTagName(DOMString localName); | 268 HTMLCollection getElementsByTagName(DOMString qualifiedName); |
234 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localNam
e); | 269 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localNam
e); |
235 HTMLCollection getElementsByClassName(DOMString classNames); | 270 HTMLCollection getElementsByClassName(DOMString classNames); |
236 | 271 |
237 [NewObject] Element createElement(DOMString localName); | 272 [NewObject] Element createElement(DOMString localName, optional ElementCreatio
nOptions options); |
238 [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedN
ame); | 273 [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedN
ame, optional ElementCreationOptions options); |
239 [NewObject] DocumentFragment createDocumentFragment(); | 274 [NewObject] DocumentFragment createDocumentFragment(); |
240 [NewObject] Text createTextNode(DOMString data); | 275 [NewObject] Text createTextNode(DOMString data); |
241 [NewObject] Comment createComment(DOMString data); | 276 [NewObject] Comment createComment(DOMString data); |
242 [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target
, DOMString data); | 277 [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target
, DOMString data); |
243 | 278 |
244 [NewObject] Node importNode(Node node, optional boolean deep = false); | 279 [NewObject] Node importNode(Node node, optional boolean deep = false); |
245 Node adoptNode(Node node); | 280 Node adoptNode(Node node); |
246 | 281 |
247 [NewObject] Attr createAttribute(DOMString localName); | 282 [NewObject] Attr createAttribute(DOMString localName); |
248 [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name); | 283 [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedNa
me); |
249 | 284 |
250 [NewObject] Event createEvent(DOMString interface); | 285 [NewObject] Event createEvent(DOMString interface); |
251 | 286 |
252 [NewObject] Range createRange(); | 287 [NewObject] Range createRange(); |
253 | 288 |
254 // NodeFilter.SHOW_ALL = 0xFFFFFFFF | 289 // NodeFilter.SHOW_ALL = 0xFFFFFFFF |
255 [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long
whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); | 290 [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long
whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); |
256 [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long what
ToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); | 291 [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long what
ToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); |
257 }; | 292 }; |
258 | 293 |
| 294 [Exposed=Window] |
259 interface XMLDocument : Document {}; | 295 interface XMLDocument : Document {}; |
260 | 296 |
| 297 dictionary ElementCreationOptions { |
| 298 DOMString is; |
| 299 }; |
| 300 |
| 301 |
| 302 [Exposed=Window] |
261 interface DOMImplementation { | 303 interface DOMImplementation { |
262 [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString
publicId, DOMString systemId); | 304 [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString
publicId, DOMString systemId); |
263 [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=Empt
yString] DOMString qualifiedName, optional DocumentType? doctype = null); | 305 [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=Empt
yString] DOMString qualifiedName, optional DocumentType? doctype = null); |
264 [NewObject] Document createHTMLDocument(optional DOMString title); | 306 [NewObject] Document createHTMLDocument(optional DOMString title); |
265 | 307 |
266 boolean hasFeature(); // useless; always returns true | 308 boolean hasFeature(); // useless; always returns true |
267 }; | 309 }; |
268 | 310 |
269 [Constructor] | |
270 interface DocumentFragment : Node { | |
271 }; | |
272 | 311 |
| 312 [Exposed=Window] |
273 interface DocumentType : Node { | 313 interface DocumentType : Node { |
274 readonly attribute DOMString name; | 314 readonly attribute DOMString name; |
275 readonly attribute DOMString publicId; | 315 readonly attribute DOMString publicId; |
276 readonly attribute DOMString systemId; | 316 readonly attribute DOMString systemId; |
277 }; | 317 }; |
278 | 318 |
| 319 |
| 320 [Constructor, |
| 321 Exposed=Window] |
| 322 interface DocumentFragment : Node { |
| 323 }; |
| 324 |
| 325 |
| 326 [Exposed=Window] |
| 327 interface ShadowRoot : DocumentFragment { |
| 328 readonly attribute ShadowRootMode mode; |
| 329 readonly attribute Element host; |
| 330 }; |
| 331 |
| 332 enum ShadowRootMode { "open", "closed" }; |
| 333 |
| 334 |
| 335 [Exposed=Window] |
279 interface Element : Node { | 336 interface Element : Node { |
280 readonly attribute DOMString? namespaceURI; | 337 readonly attribute DOMString? namespaceURI; |
281 readonly attribute DOMString? prefix; | 338 readonly attribute DOMString? prefix; |
282 readonly attribute DOMString localName; | 339 readonly attribute DOMString localName; |
283 readonly attribute DOMString tagName; | 340 readonly attribute DOMString tagName; |
284 | 341 |
285 attribute DOMString id; | 342 attribute DOMString id; |
286 attribute DOMString className; | 343 attribute DOMString className; |
287 [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; | 344 [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; |
| 345 attribute DOMString slot; |
288 | 346 |
289 boolean hasAttributes(); | 347 boolean hasAttributes(); |
290 [SameObject] readonly attribute NamedNodeMap attributes; | 348 [SameObject] readonly attribute NamedNodeMap attributes; |
291 sequence<DOMString> getAttributeNames(); | 349 sequence<DOMString> getAttributeNames(); |
292 DOMString? getAttribute(DOMString name); | 350 DOMString? getAttribute(DOMString qualifiedName); |
293 DOMString? getAttributeNS(DOMString? namespace, DOMString localName); | 351 DOMString? getAttributeNS(DOMString? namespace, DOMString localName); |
294 void setAttribute(DOMString name, DOMString value); | 352 void setAttribute(DOMString qualifiedName, DOMString value); |
295 void setAttributeNS(DOMString? namespace, DOMString name, DOMString value); | 353 void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString v
alue); |
296 void removeAttribute(DOMString name); | 354 void removeAttribute(DOMString qualifiedName); |
297 void removeAttributeNS(DOMString? namespace, DOMString localName); | 355 void removeAttributeNS(DOMString? namespace, DOMString localName); |
298 boolean hasAttribute(DOMString name); | 356 boolean hasAttribute(DOMString qualifiedName); |
299 boolean hasAttributeNS(DOMString? namespace, DOMString localName); | 357 boolean hasAttributeNS(DOMString? namespace, DOMString localName); |
300 | 358 |
301 Attr? getAttributeNode(DOMString name); | 359 Attr? getAttributeNode(DOMString qualifiedName); |
302 Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); | 360 Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); |
303 Attr? setAttributeNode(Attr attr); | 361 Attr? setAttributeNode(Attr attr); |
304 Attr? setAttributeNodeNS(Attr attr); | 362 Attr? setAttributeNodeNS(Attr attr); |
305 Attr removeAttributeNode(Attr attr); | 363 Attr removeAttributeNode(Attr attr); |
306 | 364 |
| 365 ShadowRoot attachShadow(ShadowRootInit init); |
| 366 readonly attribute ShadowRoot? shadowRoot; |
| 367 |
307 Element? closest(DOMString selectors); | 368 Element? closest(DOMString selectors); |
308 boolean matches(DOMString selectors); | 369 boolean matches(DOMString selectors); |
| 370 boolean webkitMatchesSelector(DOMString selectors); // historical alias of .ma
tches |
309 | 371 |
310 HTMLCollection getElementsByTagName(DOMString localName); | 372 HTMLCollection getElementsByTagName(DOMString qualifiedName); |
311 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localNam
e); | 373 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localNam
e); |
312 HTMLCollection getElementsByClassName(DOMString classNames); | 374 HTMLCollection getElementsByClassName(DOMString classNames); |
| 375 |
| 376 Element? insertAdjacentElement(DOMString where, Element element); // historica
l |
| 377 void insertAdjacentText(DOMString where, DOMString data); // historical |
313 }; | 378 }; |
314 | 379 |
| 380 dictionary ShadowRootInit { |
| 381 // required ShadowRootMode mode; |
| 382 }; |
| 383 |
| 384 |
| 385 [Exposed=Window, LegacyUnenumerableNamedProperties] |
315 interface NamedNodeMap { | 386 interface NamedNodeMap { |
316 readonly attribute unsigned long length; | 387 readonly attribute unsigned long length; |
317 getter Attr? item(unsigned long index); | 388 getter Attr? item(unsigned long index); |
318 getter Attr? getNamedItem(DOMString name); | 389 getter Attr? getNamedItem(DOMString qualifiedName); |
319 Attr? getNamedItemNS(DOMString? namespace, DOMString localName); | 390 Attr? getNamedItemNS(DOMString? namespace, DOMString localName); |
320 Attr? setNamedItem(Attr attr); | 391 Attr? setNamedItem(Attr attr); |
321 Attr? setNamedItemNS(Attr attr); | 392 Attr? setNamedItemNS(Attr attr); |
322 Attr removeNamedItem(DOMString name); | 393 Attr removeNamedItem(DOMString qualifiedName); |
323 Attr removeNamedItemNS(DOMString? namespace, DOMString localName); | 394 Attr removeNamedItemNS(DOMString? namespace, DOMString localName); |
324 }; | 395 }; |
325 | 396 |
| 397 |
| 398 [Exposed=Window] |
326 interface Attr { | 399 interface Attr { |
327 readonly attribute DOMString? namespaceURI; | 400 readonly attribute DOMString? namespaceURI; |
328 readonly attribute DOMString? prefix; | 401 readonly attribute DOMString? prefix; |
329 readonly attribute DOMString localName; | 402 readonly attribute DOMString localName; |
330 readonly attribute DOMString name; | 403 readonly attribute DOMString name; |
| 404 readonly attribute DOMString nodeName; // historical alias of .name |
331 attribute DOMString value; | 405 attribute DOMString value; |
332 attribute DOMString nodeValue; // legacy alias of .value | 406 [TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias o
f .value |
333 attribute DOMString textContent; // legacy alias of .value | 407 [TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias
of .value |
334 | 408 |
335 readonly attribute Element? ownerElement; | 409 readonly attribute Element? ownerElement; |
336 | 410 |
337 readonly attribute boolean specified; // useless; always returns true | 411 readonly attribute boolean specified; // useless; always returns true |
338 }; | 412 }; |
339 | 413 |
| 414 [Exposed=Window] |
340 interface CharacterData : Node { | 415 interface CharacterData : Node { |
341 [TreatNullAs=EmptyString] attribute DOMString data; | 416 [TreatNullAs=EmptyString] attribute DOMString data; |
342 readonly attribute unsigned long length; | 417 readonly attribute unsigned long length; |
343 DOMString substringData(unsigned long offset, unsigned long count); | 418 DOMString substringData(unsigned long offset, unsigned long count); |
344 void appendData(DOMString data); | 419 void appendData(DOMString data); |
345 void insertData(unsigned long offset, DOMString data); | 420 void insertData(unsigned long offset, DOMString data); |
346 void deleteData(unsigned long offset, unsigned long count); | 421 void deleteData(unsigned long offset, unsigned long count); |
347 void replaceData(unsigned long offset, unsigned long count, DOMString data); | 422 void replaceData(unsigned long offset, unsigned long count, DOMString data); |
348 }; | 423 }; |
349 | 424 |
350 [Constructor(optional DOMString data = "")] | 425 |
| 426 [Constructor(optional DOMString data = ""), |
| 427 Exposed=Window] |
351 interface Text : CharacterData { | 428 interface Text : CharacterData { |
352 [NewObject] Text splitText(unsigned long offset); | 429 [NewObject] Text splitText(unsigned long offset); |
353 readonly attribute DOMString wholeText; | 430 readonly attribute DOMString wholeText; |
354 }; | 431 }; |
355 | 432 |
| 433 [Exposed=Window] |
356 interface ProcessingInstruction : CharacterData { | 434 interface ProcessingInstruction : CharacterData { |
357 readonly attribute DOMString target; | 435 readonly attribute DOMString target; |
358 }; | 436 }; |
359 | 437 |
360 [Constructor(optional DOMString data = "")] | 438 [Constructor(optional DOMString data = ""), |
| 439 Exposed=Window] |
361 interface Comment : CharacterData { | 440 interface Comment : CharacterData { |
362 }; | 441 }; |
363 | 442 |
364 [Constructor] | 443 |
| 444 [Constructor, |
| 445 Exposed=Window] |
365 interface Range { | 446 interface Range { |
366 readonly attribute Node startContainer; | 447 readonly attribute Node startContainer; |
367 readonly attribute unsigned long startOffset; | 448 readonly attribute unsigned long startOffset; |
368 readonly attribute Node endContainer; | 449 readonly attribute Node endContainer; |
369 readonly attribute unsigned long endOffset; | 450 readonly attribute unsigned long endOffset; |
370 readonly attribute boolean collapsed; | 451 readonly attribute boolean collapsed; |
371 readonly attribute Node commonAncestorContainer; | 452 readonly attribute Node commonAncestorContainer; |
372 | 453 |
373 void setStart(Node node, unsigned long offset); | 454 void setStart(Node node, unsigned long offset); |
374 void setEnd(Node node, unsigned long offset); | 455 void setEnd(Node node, unsigned long offset); |
(...skipping 21 matching lines...) Expand all Loading... |
396 void detach(); | 477 void detach(); |
397 | 478 |
398 boolean isPointInRange(Node node, unsigned long offset); | 479 boolean isPointInRange(Node node, unsigned long offset); |
399 short comparePoint(Node node, unsigned long offset); | 480 short comparePoint(Node node, unsigned long offset); |
400 | 481 |
401 boolean intersectsNode(Node node); | 482 boolean intersectsNode(Node node); |
402 | 483 |
403 stringifier; | 484 stringifier; |
404 }; | 485 }; |
405 | 486 |
| 487 |
| 488 [Exposed=Window] |
406 interface NodeIterator { | 489 interface NodeIterator { |
407 [SameObject] readonly attribute Node root; | 490 [SameObject] readonly attribute Node root; |
408 readonly attribute Node referenceNode; | 491 readonly attribute Node referenceNode; |
409 readonly attribute boolean pointerBeforeReferenceNode; | 492 readonly attribute boolean pointerBeforeReferenceNode; |
410 readonly attribute unsigned long whatToShow; | 493 readonly attribute unsigned long whatToShow; |
411 readonly attribute NodeFilter? filter; | 494 readonly attribute NodeFilter? filter; |
412 | 495 |
413 Node? nextNode(); | 496 Node? nextNode(); |
414 Node? previousNode(); | 497 Node? previousNode(); |
415 | 498 |
416 void detach(); | 499 void detach(); |
417 }; | 500 }; |
418 | 501 |
| 502 |
| 503 [Exposed=Window] |
419 interface TreeWalker { | 504 interface TreeWalker { |
420 [SameObject] readonly attribute Node root; | 505 [SameObject] readonly attribute Node root; |
421 readonly attribute unsigned long whatToShow; | 506 readonly attribute unsigned long whatToShow; |
422 readonly attribute NodeFilter? filter; | 507 readonly attribute NodeFilter? filter; |
423 attribute Node currentNode; | 508 attribute Node currentNode; |
424 | 509 |
425 Node? parentNode(); | 510 Node? parentNode(); |
426 Node? firstChild(); | 511 Node? firstChild(); |
427 Node? lastChild(); | 512 Node? lastChild(); |
428 Node? previousSibling(); | 513 Node? previousSibling(); |
429 Node? nextSibling(); | 514 Node? nextSibling(); |
430 Node? previousNode(); | 515 Node? previousNode(); |
431 Node? nextNode(); | 516 Node? nextNode(); |
432 }; | 517 }; |
433 | 518 |
| 519 [Exposed=Window] |
434 callback interface NodeFilter { | 520 callback interface NodeFilter { |
435 // Constants for acceptNode() | 521 // Constants for acceptNode() |
436 const unsigned short FILTER_ACCEPT = 1; | 522 const unsigned short FILTER_ACCEPT = 1; |
437 const unsigned short FILTER_REJECT = 2; | 523 const unsigned short FILTER_REJECT = 2; |
438 const unsigned short FILTER_SKIP = 3; | 524 const unsigned short FILTER_SKIP = 3; |
439 | 525 |
440 // Constants for whatToShow | 526 // Constants for whatToShow |
441 const unsigned long SHOW_ALL = 0xFFFFFFFF; | 527 const unsigned long SHOW_ALL = 0xFFFFFFFF; |
442 const unsigned long SHOW_ELEMENT = 0x1; | 528 const unsigned long SHOW_ELEMENT = 0x1; |
443 const unsigned long SHOW_ATTRIBUTE = 0x2; // historical | 529 const unsigned long SHOW_ATTRIBUTE = 0x2; // historical |
444 const unsigned long SHOW_TEXT = 0x4; | 530 const unsigned long SHOW_TEXT = 0x4; |
445 const unsigned long SHOW_CDATA_SECTION = 0x8; // historical | 531 const unsigned long SHOW_CDATA_SECTION = 0x8; // historical |
446 const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical | 532 const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical |
447 const unsigned long SHOW_ENTITY = 0x20; // historical | 533 const unsigned long SHOW_ENTITY = 0x20; // historical |
448 const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40; | 534 const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40; |
449 const unsigned long SHOW_COMMENT = 0x80; | 535 const unsigned long SHOW_COMMENT = 0x80; |
450 const unsigned long SHOW_DOCUMENT = 0x100; | 536 const unsigned long SHOW_DOCUMENT = 0x100; |
451 const unsigned long SHOW_DOCUMENT_TYPE = 0x200; | 537 const unsigned long SHOW_DOCUMENT_TYPE = 0x200; |
452 const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400; | 538 const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400; |
453 const unsigned long SHOW_NOTATION = 0x800; // historical | 539 const unsigned long SHOW_NOTATION = 0x800; // historical |
454 | 540 |
455 unsigned short acceptNode(Node node); | 541 unsigned short acceptNode(Node node); |
456 }; | 542 }; |
457 | 543 |
| 544 |
458 interface DOMTokenList { | 545 interface DOMTokenList { |
459 readonly attribute unsigned long length; | 546 readonly attribute unsigned long length; |
460 getter DOMString? item(unsigned long index); | 547 getter DOMString? item(unsigned long index); |
461 boolean contains(DOMString token); | 548 boolean contains(DOMString token); |
462 void add(DOMString... tokens); | 549 void add(DOMString... tokens); |
463 void remove(DOMString... tokens); | 550 void remove(DOMString... tokens); |
464 boolean toggle(DOMString token, optional boolean force); | 551 boolean toggle(DOMString token, optional boolean force); |
465 void replace(DOMString token, DOMString newToken); | 552 void replace(DOMString token, DOMString newToken); |
466 boolean supports(DOMString token); | 553 boolean supports(DOMString token); |
467 attribute DOMString value; | 554 attribute DOMString value; |
(...skipping 30 matching lines...) Expand all Loading... |
498 Range: ['document.createRange()', 'detachedRange'], | 585 Range: ['document.createRange()', 'detachedRange'], |
499 NodeIterator: ['document.createNodeIterator(document.body, NodeFilter.SHOW_A
LL, null, false)'], | 586 NodeIterator: ['document.createNodeIterator(document.body, NodeFilter.SHOW_A
LL, null, false)'], |
500 TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL,
null, false)'], | 587 TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL,
null, false)'], |
501 NodeList: ['document.querySelectorAll("script")'], | 588 NodeList: ['document.querySelectorAll("script")'], |
502 HTMLCollection: ['document.body.children'], | 589 HTMLCollection: ['document.body.children'], |
503 DOMTokenList: ['document.body.classList'], | 590 DOMTokenList: ['document.body.classList'], |
504 }); | 591 }); |
505 }); | 592 }); |
506 idlArray.test(); | 593 idlArray.test(); |
507 </script> | 594 </script> |
OLD | NEW |