3 <script src=../editing.js
language=
"JavaScript" type=
"text/JavaScript" ></script>
7 testRunner
.dumpAsText();
9 function editingTest() {
10 var word
= document
.getElementById("word");
11 var x
= word
.offsetLeft
;
12 var y
= word
.offsetTop
;
13 eventSender
.mouseMoveTo(x
, y
);
14 eventSender
.mouseDown();
15 eventSender
.mouseUp();
16 eventSender
.mouseDown();
17 eventSender
.mouseUp();
19 document
.execCommand("Delete");
20 document
.execCommand("Undo");
22 var selection
= window
.getSelection();
23 if (selection
.anchorNode
!= document
.getElementById("root").firstChild
||
24 selection
.anchorOffset
!= 4 ||
25 selection
.focusNode
!= word
.firstChild
||
26 selection
.focusOffset
!= 3) {
27 document
.getElementById("result").innerHTML
= "FAILED";
28 console
.log(selection
.anchorNode
);
29 console
.log(selection
.anchorOffset
);
30 console
.log(selection
.focusNode
);
31 console
.log(selection
.focusOffset
);
33 document
.getElementById("result").innerHTML
= "PASSED";
40 <div class=
"explanation">
41 <div class=
"scenario">
44 Select a word via double-click. Delete. Then undo the delete. The space that got smart deleted should now be selected.
48 <div contenteditable
id=
"root">
49 foo
<span id=
"word">bar
</span> baz
52 <div id=
"result"></div>