Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / toString-1.html
blobf9d1bbf4561a263991537a6c48828cab60c4bef2
1 <script>
2 if (window.testRunner)
3 testRunner.dumpEditingCallbacks();
4 </script>
5 <script>
6 function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
13 function runTest() {
14 try {
15 if (window.testRunner)
16 window.testRunner.dumpAsText();
18 var selection = window.getSelection();
19 var bodyElement = document.getElementById("test");
20 var htmlElement = bodyElement.parentNode;
22 if (selection.setBaseAndExtent)
23 selection.setBaseAndExtent(bodyElement, 1, htmlElement, 3);
24 else
25 throw("Couldn't set a selection.");
27 if (selection.toString) {
28 var string = selection.toString();
29 if (string != "\nbbbb")
30 throw("toString returned unexpected result");
31 log("success");
32 } else
33 throw("Selection::toString() not supported");
34 } catch(e) {
35 log("Test Failed. Error was: " + e);
38 </script>
39 <body id="test" contenteditable>aaaa<object></object><div>bbbb</div>
40 <ul id="console"></ul>
41 <script>runTest();</script>
42 </body>