|
1 <!doctype html> |
|
2 <title>Selection interface tests</title> |
|
3 <div id=log></div> |
|
4 <script src=/resources/testharness.js></script> |
|
5 <script src=/resources/testharnessreport.js></script> |
|
6 <script src=/resources/WebIDLParser.js></script> |
|
7 <script src=/resources/idlharness.js></script> |
|
8 <script type=text/plain> |
|
9 interface Selection { |
|
10 readonly attribute Node? anchorNode; |
|
11 readonly attribute unsigned long anchorOffset; |
|
12 readonly attribute Node? focusNode; |
|
13 readonly attribute unsigned long focusOffset; |
|
14 |
|
15 readonly attribute boolean isCollapsed; |
|
16 void collapse(Node node, unsigned long offset); |
|
17 void collapseToStart(); |
|
18 void collapseToEnd(); |
|
19 |
|
20 void extend(Node node, unsigned long offset); |
|
21 |
|
22 void selectAllChildren(Node node); |
|
23 void deleteFromDocument(); |
|
24 |
|
25 readonly attribute unsigned long rangeCount; |
|
26 Range getRangeAt(unsigned long index); |
|
27 void addRange(Range range); |
|
28 void removeRange(Range range); |
|
29 void removeAllRanges(); |
|
30 |
|
31 stringifier; |
|
32 }; |
|
33 </script> |
|
34 <script> |
|
35 "use strict"; |
|
36 |
|
37 var idlArray = new IdlArray(); |
|
38 idlArray.add_idls(document.querySelector("script[type=text\\/plain]").textContent); |
|
39 idlArray.add_objects({Selection: ['getSelection()']}); |
|
40 idlArray.test(); |
|
41 </script> |