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>
6 var li
= document
.createElement("li");
7 li
.appendChild(document
.createTextNode(str
));
8 var console
= document
.getElementById("console");
9 console
.appendChild(li
);
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.");
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
);