editor/libeditor/html/tests/test_bug832025.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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">
    17 /**
    18  * Test for Bug 832025
    19  *
    20  */
    22 document.execCommand("stylewithcss", false, "true");
    23 var test = document.getElementById("test");
    24 test.focus();
    26 // place caret at end of editable area
    27 var sel = getSelection();
    28 sel.collapse(test, test.childNodes.length);
    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");
    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");
    40 </script>
    41 </body>
    42 </html>

mercurial