1 <p>A selection created with setBaseAndExtent should be directional
</p>
2 <div id=
"div" contenteditable=
"true">There should be four characters selected in this sentence.
</div>
6 document
.getElementById("console").innerHTML
+= str
+ "<br>";
9 if (window
.testRunner
) {
10 window
.testRunner
.dumpAsText();
12 var text
= document
.getElementById("div").firstChild
;
13 var selection
= window
.getSelection();
15 selection
.collapse(text
, 0);
16 selection
.modify("move", "forward", "character");
18 selection
.setBaseAndExtent(text
, 5 + 7, text
, 5);
19 // Extending this 5 character selection will select 6 characters.
20 testRunner
.execCommand("MoveForwardAndModifySelection");
21 var selectedText
= selection
.toString();
22 var expectedText
= "should";
23 if (selectedText
!= expectedText
)
24 log("Failure: Selected text was \"" + selectedText
+ "\" and should be \"" + expectedText
+ "\"");
28 log("Failure: This test cannot be run manually.")