| <script src="../../resources/dump-as-markup.js"></script> |
| <div id="test" contenteditable="true">The second word, and only the second word of this sentence should have a red background color.</div> |
| <script> |
| if (window.layoutTestController) |
| layoutTestController.dumpEditingCallbacks(); |
| |
| var sel = window.getSelection(); |
| var e = document.getElementById("test"); |
| |
| sel.setPosition(e, 0); |
| sel.modify("move", "forward", "word"); |
| sel.modify("move", "forward", "word"); |
| sel.modify("extend", "backward", "word"); |
| document.execCommand("HiliteColor", false, "red"); |
| sel.modify("move", "backward", "line"); |
| |
| Markup.dump('test') |
| </script> |