Bumping manifests a=b2g-bump
[gecko.git] / editor / libeditor / tests / test_bug552782.html
blob5c53e92c167934c3ec36e36e30dcd8602022a5d5
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=552782
5 -->
6 <head>
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"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=290026">Mozilla Bug 552782</a>
14 <p id="display"></p>
15 <div id="editor" contenteditable></div>
17 <pre id="test">
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;
26 editor.focus();
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");
40 // done
41 SimpleTest.finish();
42 });
44 </script>
45 </pre>
46 </body>
47 </html>