Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-indent.html
blob74d24d836008a77a5135ef48c7dcc3887facffc8
1 <html>
2 <body>
3 <div>
4 This tests indenting "three" then undoing the indent. You should see one, two and three numbered 1 through 3 then four as a sublist with number 1.
5 <p>
6 <a href="https://bugs.webkit.org/show_bug.cgi?id=28722">Bugzilla bug</a>
7 <br>
8 <a href="rdar://problem/7169206">Radar bug</a>
9 </p>
10 <ol id="e" contenteditable="true">
11 <li>one</li>
12 <li>two</li>
13 <li id="test">three</li>
14 <ol><li>four</li></ol>
15 </ol>
16 </div>
18 <ul>
19 <li>Before indent:<span id="c1"></span></li>
20 <li>After indent:<span id="c2"></span></li>
21 <li>After undoing:<span id="c3"></span></li>
22 </ul>
24 <script type="text/javascript">
26 if (window.testRunner) {
27 testRunner.dumpEditingCallbacks();
28 testRunner.dumpAsText();
31 var e = document.getElementById('e');
33 document.getElementById('c1').appendChild(document.createTextNode(e.innerHTML));
35 var s = window.getSelection();
36 var r = document.createRange();
37 r.selectNode(document.getElementById('test'));
38 s.removeAllRanges();
39 s.addRange(r);
40 document.execCommand("Indent", false, "");
41 document.getElementById('c2').appendChild(document.createTextNode(e.innerHTML));
43 document.execCommand("Undo");
44 document.getElementById('c3').appendChild(document.createTextNode(e.innerHTML));
46 if (document.getElementById('c1').innerHTML == document.getElementById('c3').innerHTML)
47 document.write("The test passed");
48 else
49 document.write("The test failed.");
50 </script>