Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-smart-delete-word.html
blob4f576dc76973b75c1cec2774609919d63843744b
1 <html>
2 <head>
3 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
5 <script>
6 if (window.testRunner)
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);
32 } else
33 document.getElementById("result").innerHTML = "PASSED";
36 </script>
37 </head>
38 <body>
40 <div class="explanation">
41 <div class="scenario">
42 Tests:
43 <br>
44 Select a word via double-click. Delete. Then undo the delete. The space that got smart deleted should now be selected.
45 </div>
46 </div>
48 <div contenteditable id="root">
49 foo <span id="word">bar</span> baz
50 </div>
52 <div id="result"></div>
53 <script>
54 editingTest();
55 </script>
57 </body>
58 </html>