9 border: 2px solid blue;
14 .scenario { margin-bottom: 16px;}
15 .scenario:first-line { font-weight: bold; margin-bottom: 16px;}
17 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
21 function sendDeleteWordKey()
23 var deleteWordModifiers;
24 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
25 deleteWordModifiers = ["altKey"];
27 deleteWordModifiers = ["ctrlKey"];
29 if (window.eventSender)
30 eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers);
31 window.setTimeout(undoNow, 100);
36 document.execCommand("Undo");
38 if (window.testRunner)
39 testRunner.notifyDone();
42 function editingTest() {
43 typeCharacterCommand('o');
44 typeCharacterCommand('n');
45 typeCharacterCommand('e');
46 typeCharacterCommand(' ');
47 typeCharacterCommand('t');
48 typeCharacterCommand('w');
49 typeCharacterCommand('o');
50 typeCharacterCommand(' ');
51 typeCharacterCommand('t');
52 typeCharacterCommand('h');
53 typeCharacterCommand('r');
54 typeCharacterCommand('e');
55 typeCharacterCommand('e');
56 typeCharacterCommand(' ');
57 typeCharacterCommand('f');
58 typeCharacterCommand('o');
59 typeCharacterCommand('u');
60 typeCharacterCommand('r');
62 window.setTimeout(sendDeleteWordKey, 100);
67 <title>Editing Test</title>
71 <div class="explanation">
72 <div class="scenario">
75 Undo a delete word after a series of insertText does not wipe out the entire content.
79 <div contenteditable id="root">
80 <div id="test" class="editing"></div>
84 if (window.testRunner) {
85 testRunner.dumpAsText();
86 testRunner.waitUntilDone();
89 var selection = window.getSelection();
90 selection.collapse(document.getElementById("test"), 0);