LayoutTests:
[WebKit-https.git] / LayoutTests / editing / input / range-for-empty-document.html
1 <HTML>
2 <HEAD>
3 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
4 </HEAD>
5 <BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">
6 <script>
7     var console_messages = document.createElement("ol");
8     
9     function log(message)
10     {
11         var item = document.createElement("li");
12         item.appendChild(document.createTextNode(String(message).replace(/0x[0-9a-fA-F]{8}/g, "0xXXXXXXXX").replace(/\n/g, "\\n").replace(/\t/g, "\\t")));
13         console_messages.appendChild(item);
14     }
15     
16     if (window.layoutTestController) {
17         
18         try {
19         
20             layoutTestController.dumpAsText();
21         
22             window.getSelection().setPosition(document.body, 0);
23
24                         // should not be (0, 0, 0, 0)
25             log("(0, 0): " + textInputController.firstRectForCharacterRange(0, 0));
26
27             document.body.innerHTML = "";
28
29         } catch (ex) {
30             log("Exception: " + ex.description);
31         }
32         
33         var console = document.createElement("p");
34         console.appendChild(console_messages);
35         document.body.appendChild(console);
36         
37     } else {
38         document.write("(cannot run interactively)");
39     }
40 </script>
41 </BODY>
42 </HTML>