| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <body> | |
| 3 <div> | |
| 4 This tests indenting "three" then executes the undo command after changing the e
ditability to false. | |
| 5 You should see one, two numbered 1 through 2 then three and four as a sublist st
arting 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> | |
| 19 | |
| 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> | |
| 25 | |
| 26 <script type="text/javascript"> | |
| 27 | |
| 28 if (window.testRunner) | |
| 29 testRunner.dumpAsText(); | |
| 30 | |
| 31 var e = document.getElementById('e'); | |
| 32 | |
| 33 document.getElementById('c1').appendChild(document.createTextNode(e.innerHTML)); | |
| 34 | |
| 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)); | |
| 45 | |
| 46 if (document.getElementById('c2').innerHTML == document.getElementById('c3').inn
erHTML) | |
| 47 document.write("The test passed"); | |
| 48 else | |
| 49 document.write("The test failed."); | |
| 50 </script> | |
| OLD | NEW |