1 <script src="../../resources/dump-as-markup.js"></script>
2 <div id="test" contenteditable="true">The second word, and only the second word of this sentence should have a red background color.</div>
4 if (window.layoutTestController)
5 layoutTestController.dumpEditingCallbacks();
7 var sel = window.getSelection();
8 var e = document.getElementById("test");
10 sel.setPosition(e, 0);
11 sel.modify("move", "forward", "word");
12 sel.modify("move", "forward", "word");
13 sel.modify("extend", "backward", "word");
14 document.execCommand("HiliteColor", false, "red");
15 sel.modify("move", "backward", "line");