editor/libeditor/html/tests/test_bug832025.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:d0b0fb758ce6
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=832025
5 -->
6 <head>
7 <title>Test for Bug 832025</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=832025">Mozilla Bug 832025</a>
14 <div id="test" contenteditable="true">header1</div>
15 <script type="application/javascript">
16
17 /**
18 * Test for Bug 832025
19 *
20 */
21
22 document.execCommand("stylewithcss", false, "true");
23 var test = document.getElementById("test");
24 test.focus();
25
26 // place caret at end of editable area
27 var sel = getSelection();
28 sel.collapse(test, test.childNodes.length);
29
30 // make it a H1
31 document.execCommand("heading", false, "H1");
32 // simulate a CR key
33 sendKey("return");
34 // insert some text
35 document.execCommand("insertText", false, "abc");
36
37 is(test.innerHTML == '<h1>header1</h1><p>abc<br></p>',
38 true, "A paragraph automatically created after a CR at the end of an H1 should not be bold");
39
40 </script>
41 </body>
42 </html>

mercurial