Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / rangeCount.html
blob636048539962ec899eb01f03ce708baccf2f8360
1 <p>This tests Selection::rangeCount. You should see "Hello World" selected below. You should not see any failures below.</p>
2 <div id="div" contenteditable="true">Hello World</div>
3 <ul id="console"></ul>
4 <script>
5 function log(str) {
6 var li = document.createElement("li");
7 li.appendChild(document.createTextNode(str));
8 var console = document.getElementById("console");
9 console.appendChild(li);
12 function runTest() {
14 try {
15 if (window.testRunner)
16 window.testRunner.dumpAsText();
18 var div = document.getElementById("div");
19 var text = div.firstChild;
20 var sel = window.getSelection();
22 if (sel.rangeCount == undefined) {
23 log("Selection::rangeCount not implemented.");
24 return;
27 if (sel.rangeCount != 0)
28 log("Failure. Expected: rangeCount == 0, Found: " + sel.rangeCount);
30 sel.collapse(text, 0);
31 if (sel.rangeCount != 1)
32 log("Failure. Expected: rangeCount == 1, Found: " + sel.rangeCount);
34 document.execCommand("SelectAll");
35 if (sel.rangeCount != 1)
36 log("Failure. Expected: rangeCount == 1, Found: " + sel.rangeCount);
38 } catch(e) {
39 log(e);
43 runTest();
44 </script>