4 https://bugzilla.mozilla.org/show_bug.cgi?id=552782
7 <title>Test for Bug
552782</title>
8 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script type=
"text/javascript" 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() {
30 var sel = window.getSelection();
31 sel.removeAllRanges();
32 var lis = document.getElementsByTagName(
"li");
33 sel.selectAllChildren(lis[
2]);
34 document.execCommand(
"outdent", false, false);
35 var expected = '
<ol><li>Item
1</li><ol><li>Item
2</li></ol><li>Item
3</li><ol><li>Item
4</li></ol></ol>';
36 is(editor.innerHTML, expected,
"outdenting third item in a partially indented numbered list");
37 document.execCommand(
"indent", false, false);
38 todo_is(editor.innerHTML, original,
"re-indenting third item in a partially indented numbered list");