Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/domxpath/interfaces.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <title>XPath tests</title>
3 <script src='/resources/testharness.js'></script>
4 <script src='/resources/testharnessreport.js'></script>
5 <script src='/resources/WebIDLParser.js'></script>
6 <script src='/resources/idlharness.js'></script>
7 <script type='text/plain'>
8 [Constructor] interface XPathEvaluator {
9 [NewObject] XPathExpression createExpression(DOMString expression,
10 optional XPathNSResolver? resolve r);
11 Node createNSResolver(Node nodeResolver);
12 XPathResult evaluate(DOMString expression, Node contextNode,
13 optional XPathNSResolver? resolver,
14 optional unsigned short type,
15 optional object? result);
16 };
17
18 interface XPathExpression {
19 XPathResult evaluate(Node contextNode,
20 optional unsigned short type,
21 optional object? result);
22 };
23
24 callback interface XPathNSResolver {
25 DOMString? lookupNamespaceURI(DOMString? prefix);
26 };
27
28 interface XPathResult {
29 const unsigned short ANY_TYPE = 0;
30 const unsigned short NUMBER_TYPE = 1;
31 const unsigned short STRING_TYPE = 2;
32 const unsigned short BOOLEAN_TYPE = 3;
33 const unsigned short UNORDERED_NODE_ITERATOR_TYPE = 4;
34 const unsigned short ORDERED_NODE_ITERATOR_TYPE = 5;
35 const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
36 const unsigned short ORDERED_NODE_SNAPSHOT_TYPE = 7;
37 const unsigned short ANY_UNORDERED_NODE_TYPE = 8;
38 const unsigned short FIRST_ORDERED_NODE_TYPE = 9;
39 readonly attribute unsigned short resultType;
40 readonly attribute double numberValue;
41 readonly attribute DOMString stringValue;
42 readonly attribute boolean booleanValue;
43 readonly attribute Node? singleNodeValue;
44 readonly attribute boolean invalidIteratorState;
45 readonly attribute unsigned long snapshotLength;
46 Node? iterateNext();
47 Node? snapshotItem(unsigned long index);
48 };
49 </script>
50 <script type='text/plain' class='untested'>
51 interface Document {};
52 Document implements XPathEvaluator;
53 </script>
54 <script>
55 "use strict";
56 var evaluator = document;
57 var resolver = function() {};
58 var resolver2 = document.createNSResolver(document.documentElement);
59 var expression = document.createExpression("//*", resolver);
60 var result = document.evaluate("//*", document.documentElement, resolver, 0, nul l);
61
62 var idlArray;
63 setup(function() {
64 idlArray = new IdlArray();
65 [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), functi on(node) {
66 if (node.className == "untested") {
67 idlArray.add_untested_idls(node.textContent);
68 } else {
69 idlArray.add_idls(node.textContent);
70 }
71 });
72 idlArray.add_objects({
73 Document: ["document"],
74 XPathExpression: ["expression"],
75 XPathResolver: ["resolver", "resolver2"],
76 XPathResult: ["result"]
77 });
78 });
79 idlArray.test();
80 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698