Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / getRangeAt.html
blob6a998e33c45f9951f779b1e2ea4a32adae89f5e5
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpEditingCallbacks();
6 </script>
7 <script>
8 function log(str) {
9 if (str == null)
10 str = "null"
11 var li = document.createElement("li");
12 var pre = document.createElement("pre");
13 pre.appendChild(document.createTextNode(str));
14 li.appendChild(pre);
15 var console = document.getElementById("console");
16 console.appendChild(li);
19 function runTest() {
20 var elem = document.getElementById("test");
21 var sel = window.getSelection();
23 if (window.testRunner)
24 window.testRunner.dumpAsText();
26 try {
27 sel.setBaseAndExtent(elem, 0, elem, 1);
28 var range = sel.getRangeAt(0);
29 log(range);
30 log(range.startContainer);
31 log(range.endContainer);
33 } catch(e) {
34 log("Error: " + e);
37 </script></head>
38 <body onload="runTest();">
39 <p>This tests that Selection::getRangeAt(int) returns a valid Range object.</p>
40 <div id="test" style="border:1px solid black; padding:1em;">hello</div>
41 <ul id="console"></ul>
42 </body>
43 </html>