blob: 151931576c239e4e81c2ae4e1a2705a18c627e2b [file] [log] [blame]
<html>
<body>
<div>
This tests indenting "three" then executes the undo command after changing the editability to false.
You should see one, two numbered 1 through 2 then three and four as a sublist starting with number 1.
The undo should have no effect.
<p>
<a href="https://bugs.webkit.org/show_bug.cgi?id=32079">Bugzilla bug</a>
<br>
<a href="rdar://problem/6557066">Radar bug</a>
</p>
<ol id="e" contenteditable="true">
<li>one</li>
<li>two</li>
<li id="test">three</li>
<ol><li>four</li></ol>
</ol>
</div>
<ul>
<li>Before indent:<span id="c1"></span></li>
<li>After indent:<span id="c2"></span></li>
<li>After undoing:<span id="c3"></span></li>
</ul>
<script type="text/javascript">
if (window.testRunner)
testRunner.dumpAsText();
var e = document.getElementById('e');
document.getElementById('c1').appendChild(document.createTextNode(e.innerHTML));
var s = window.getSelection();
var r = document.createRange();
r.selectNode(document.getElementById('test'));
s.removeAllRanges();
s.addRange(r);
document.execCommand("Indent", false, "");
document.getElementById('c2').appendChild(document.createTextNode(e.innerHTML));
e.contentEditable = false;
document.execCommand("Undo");
document.getElementById('c3').appendChild(document.createTextNode(e.innerHTML));
if (document.getElementById('c2').innerHTML == document.getElementById('c3').innerHTML)
document.write("The test passed");
else
document.write("The test failed.");
</script>