blob: 401bf09f7b3a660a1796d0c5d65981f4ec1c50af [file] [log] [blame]
<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.internals)
internals.settings.setEditingBehavior('mac');
if (window.testRunner)
testRunner.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>