Add some temporary test/experiment files.
[odfkit:webodf.git] / webodf / misctests / selection.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head><title></title>
4 <script>
5 window.onload = function () {
6     var selection = window.getSelection(),
7         p = document.createElement("p"),
8         textnode = document.createTextNode("hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello "),
9         range;
10
11     document.body.appendChild(p);
12     p.appendChild(textnode);
13     selection.removeAllRanges();
14     range = document.createRange();
15     range.setStart(textnode, 1);
16     selection.removeAllRanges();
17     selection.addRange(range);
18
19 selection.modify("move", "forward", "line");
20
21 alert(selection.rangeCount + " " + selection.getRangeAt(0).startOffset);
22 }
23 </script>
24   </head>
25   <body>
26   </body>
27 </html>
28