Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / selectNode.html
blob0ea8ca6e4fa1b99f26280c132cac4cc95e890bab
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);
12 </script>
13 <body>
14 <p>This tests Range.selectNode() of a text node and a br.</p>
15 <div>one</div>
16 <div id=targetParent>two<br>three</div>
17 <div>four</div>
18 <ul id="console"></ul>
19 <script>
20 try {
21 // selectNode of a text node
22 textNode = targetParent.firstChild;
23 range = document.createRange();
24 range.selectNode(textNode);
25 if (range.startContainer != textNode.parentNode)
26 throw("range.startContainer != textNode.parentNode");
27 if (range.endContainer != textNode.parentNode)
28 throw("range.endContainer != textNode.parentNode");
29 if (range.startOffset != 0)
30 throw("Incorrect startOffset in div.");
31 if (range.endOffset != 1)
32 throw("Incorrect endOffset in div.");
33 if (range.toString() != "two")
34 throw("Couldn't get the contents of a text node.");
36 brNode = textNode.nextSibling;
37 range.selectNode(brNode);
38 if (range.startContainer != brNode.parentNode)
39 throw("range.startContainer != brNode.parentNode");
40 if (range.endContainer != brNode.parentNode)
41 throw("range.endContainer != brNode.parentNode");
42 if (range.startOffset != 1)
43 throw("Incorrect startOffset in br node.");
44 if (range.endOffset != 2)
45 throw("Incorrect endOffset in br node.");
46 if (range.toString() != "")
47 throw("Found br node with non-empty content.");
49 log("Success.");
50 } catch(e) {
51 log("Test Failed. Error was: " + e);
53 </script>
54 </body>