4 https://bugzilla.mozilla.org/show_bug.cgi?id=552782
7 <title>Test for Bug
552782</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=290026">Mozilla Bug
552782</a>
15 <div id=
"editor" contenteditable
></div>
18 <script type=
"application/javascript">
20 /** Test for Bug
552782 **/
21 SimpleTest.waitForExplicitFinish();
23 var original =
"<ol><li>Item 1</li><ol><li>Item 2</li><li>Item 3</li><li>Item 4</li></ol></ol>";
24 var editor = document.getElementById(
"editor");
25 editor.innerHTML = original;
28 addLoadEvent(function() {
29 var sel = window.getSelection();
30 sel.removeAllRanges();
31 var lis = document.getElementsByTagName(
"li");
32 sel.selectAllChildren(lis[
2]);
33 document.execCommand(
"outdent", false, false);
34 var expected =
"<ol><li>Item 1</li><ol><li>Item 2</li></ol><li>Item 3</li><ol><li>Item 4</li></ol></ol>";
35 is(editor.innerHTML, expected,
"outdenting third item in a partially indented numbered list");
36 document.execCommand(
"indent", false, false);
37 todo_is(editor.innerHTML, original,
"re-indenting third item in a partially indented numbered list");