test_bug832025.html (1199B)
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 src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 <script 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 document.execCommand("defaultParagraphSeparator", false, "div"); 24 var test = document.getElementById("test"); 25 test.focus(); 26 27 // place caret at end of editable area 28 var sel = getSelection(); 29 sel.collapse(test, test.childNodes.length); 30 31 // make it a H1 32 document.execCommand("formatBlock", false, "H1"); 33 // simulate a CR key 34 sendKey("return"); 35 // insert some text 36 document.execCommand("insertText", false, "abc"); 37 38 is(test.innerHTML, "<h1>header1</h1><div>abc</div>", 39 "A paragraph automatically created after a CR at the end of an H1 should not be bold"); 40 41 </script> 42 </body> 43 </html>