Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-indent-noneditable.html
blob151931576c239e4e81c2ae4e1a2705a18c627e2b
1 <html>
2 <body>
3 <div>
4 This tests indenting "three" then executes the undo command after changing the editability to false.
5 You should see one, two numbered 1 through 2 then three and four as a sublist starting with number 1.
6 The undo should have no effect.
7 <p>
8 <a href="https://bugs.webkit.org/show_bug.cgi?id=32079">Bugzilla bug</a>
9 <br>
10 <a href="rdar://problem/6557066">Radar bug</a>
11 </p>
12 <ol id="e" contenteditable="true">
13 <li>one</li>
14 <li>two</li>
15 <li id="test">three</li>
16 <ol><li>four</li></ol>
17 </ol>
18 </div>
20 <ul>
21 <li>Before indent:<span id="c1"></span></li>
22 <li>After indent:<span id="c2"></span></li>
23 <li>After undoing:<span id="c3"></span></li>
24 </ul>
26 <script type="text/javascript">
28 if (window.testRunner)
29 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));
42 e.contentEditable = false;
43 document.execCommand("Undo");
44 document.getElementById('c3').appendChild(document.createTextNode(e.innerHTML));
46 if (document.getElementById('c2').innerHTML == document.getElementById('c3').innerHTML)
47 document.write("The test passed");
48 else
49 document.write("The test failed.");
50 </script>