1 <div id=
"target">All of this should be selected
</div><div>None of this should be selected.
</div>
5 testRunner
.dumpAsText();
7 var target
= document
.getElementById("target");
8 var result
= document
.getElementById("result");
9 var sel
= getSelection();
10 sel
.setBaseAndExtent(target
, 0, target
, 1);
11 sel
.modify("extend", "forward", "sentence");
12 var selectedRange
= sel
.getRangeAt(0);
14 if (selectedRange
.startContainer
=== target
.firstChild
&& selectedRange
.startOffset
=== 0
15 && selectedRange
.endContainer
=== target
.nextSibling
&& selectedRange
.endOffset
=== 0) {
16 result
.innerText
= "PASS";
18 result
.innerText
= "FAIL: Selected range is '" + selectedRange
+ "'";