1 // META: script=/resources/WebIDLParser.js
2 // META: script=/resources/idlharness.js
3 // META: script=/common/subset-tests-by-key.js
4 // META: variant=?include=Node
5 // META: variant=?exclude=Node
8 // Note: This isn't merged into idlharness.any.js because of the use of variants,
9 // i.e., include=Node wouldn't make sense for workers.
17 self.xmlDoc = document.implementation.createDocument(null, '', null);
18 self.detachedRange = document.createRange();
19 detachedRange.detach();
20 self.element = xmlDoc.createElementNS(null, 'test');
21 element.setAttribute('bar', 'baz');
23 idl_array.add_objects({
24 EventTarget: ['new EventTarget()'],
25 Event: ['document.createEvent("Event")', 'new Event("foo")'],
26 CustomEvent: ['new CustomEvent("foo")'],
27 AbortController: ['new AbortController()'],
28 AbortSignal: ['new AbortController().signal'],
29 Document: ['new Document()'],
30 XMLDocument: ['xmlDoc'],
31 DOMImplementation: ['document.implementation'],
32 DocumentFragment: ['document.createDocumentFragment()'],
33 DocumentType: ['document.doctype'],
35 Attr: ['document.querySelector("[id]").attributes[0]'],
36 Text: ['document.createTextNode("abc")'],
37 ProcessingInstruction: ['xmlDoc.createProcessingInstruction("abc", "def")'],
38 Comment: ['document.createComment("abc")'],
39 Range: ['document.createRange()', 'detachedRange'],
40 NodeIterator: ['document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false)'],
41 TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false)'],
42 NodeList: ['document.querySelectorAll("script")'],
43 HTMLCollection: ['document.body.children'],
44 DOMTokenList: ['document.body.classList'],
45 XPathEvaluator: ['new XPathEvaluator()'],
46 XPathExpression: ['document.createExpression("//*")'],
47 XPathNSResolver: ['document.createNSResolver(document.body)'],
48 XPathResult: ['document.evaluate("//*", document.body)'],
49 XSLTProcessor: ['new XSLTProcessor()'],