Bug 1772588 [wpt PR 34302] - [wpt] Add test for block-in-inline offsetParent., a...
[gecko.git] / editor / libeditor / tests / test_bug552782.html
blob66a70cae727d150725928bd4a7fa430b9c7f2852
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 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"/>
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() {
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");
39 // done
40 SimpleTest.finish();
41 });
43 </script>
44 </pre>
45 </body>
46 </html>