Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-smart-delete-reversed-selection.html
blob71da71c81451243db2eab501160f1936c3df8705
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 getStringForNode(node) {
10 return node + "(" + node.data + ")";
13 function editingTest() {
14 var start = document.getElementById("start");
15 var x = start.offsetLeft + 5;
16 var middleY = start.offsetTop + start.offsetHeight / 2;
17 var endX = document.getElementById("end").offsetLeft;
19 eventSender.mouseMoveTo(x, middleY);
20 eventSender.mouseDown();
21 eventSender.mouseUp();
22 eventSender.mouseDown();
24 eventSender.mouseMoveTo(endX, middleY);
25 eventSender.mouseUp();
27 document.execCommand("Delete");
28 document.execCommand("Undo");
30 var selection = window.getSelection();
31 if (selection.anchorNode != start.nextSibling ||
32 selection.anchorOffset != 1 ||
33 selection.focusNode != document.getElementById("root").firstChild ||
34 selection.focusOffset != 4) {
35 document.getElementById("result").innerHTML = "FAILED. Selection was " +
36 "anchorNode:" + getStringForNode(selection.anchorNode) +
37 " anchorOffset:" + selection.anchorOffset +
38 " focusNode:" + getStringForNode(selection.focusNode) +
39 " focusOffset:" + selection.focusOffset;
40 } else
41 document.getElementById("result").innerHTML = "PASSED";
44 </script>
45 </head>
46 <body>
48 <div class="explanation">
49 <div class="scenario">
50 Tests:
51 <br>
52 Double-click the green "a" and drag backwards to select "bar baz" with word granularity. Delete, then undo the delete. The space that got smart deleted should now be selected and the anchor of the selection should be at the end of the selection.
53 </div>
54 </div>
55 <br>
56 <div contenteditable id="root">
57 foo b<span id="end">a</span>r b<span id="start" style="color:green">a</span>z biz
58 </div>
60 <div id="result"></div>
61 <script>
62 testRunner.waitUntilDone();
63 setTimeout(function() {
64 editingTest();
65 testRunner.notifyDone();
66 }, 1000);
67 </script>
69 </body>
70 </html>