4 https://bugzilla.mozilla.org/show_bug.cgi?id=290026
7 <title>Test for Bug
290026</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
290026</a>
15 <div id=
"editor" contenteditable
></div>
18 <script type=
"application/javascript">
20 /** Test for Bug
290026 **/
21 SimpleTest.waitForExplicitFinish();
23 var editor = document.getElementById(
"editor");
24 editor.innerHTML =
"<p></p><ul><li>Item 1</li><li>Item 2</li></ul><p></p>";
27 addLoadEvent(function() {
28 document.execCommand(
"stylewithcss", false,
"true");
29 var sel = window.getSelection();
30 sel.removeAllRanges();
31 var lis = document.getElementsByTagName(
"li");
32 var range = document.createRange();
33 range.setStart(lis[
0],
0);
34 range.setEnd(lis[
1], lis[
1].childNodes.length);
36 document.execCommand(
"indent", false, false);
37 var oneindent = '
<p></p><ul style=
"margin-left: 40px;"><li>Item
1</li><li>Item
2</li></ul><p></p>';
38 is(editor.innerHTML, oneindent,
"a once indented bulleted list");
39 document.execCommand(
"indent", false, false);
40 var twoindent = '
<p></p><ul style=
"margin-left: 80px;"><li>Item
1</li><li>Item
2</li></ul><p></p>';
41 is(editor.innerHTML, twoindent,
"a twice indented bulleted list");
42 document.execCommand(
"outdent", false, false);
43 is(editor.innerHTML, oneindent,
"outdenting a twice indented bulleted list");