|
1 <!DOCTYPE HTML> |
|
2 <!-- This Source Code Form is subject to the terms of the Mozilla Public |
|
3 - License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
|
5 <html> |
|
6 <!-- |
|
7 https://bugzilla.mozilla.org/show_bug.cgi?id=483651 |
|
8 --> |
|
9 |
|
10 <head> |
|
11 <title>Test for Bug 483651</title> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/MochiKit/packed.js"></script> |
|
14 <script type="application/javascript" |
|
15 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
18 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> |
|
19 </head> |
|
20 |
|
21 <body onload="doTest();"> |
|
22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=483651">Mozilla Bug 483651</a> |
|
23 <p id="display"></p> |
|
24 <div id="content" style="display: none"> |
|
25 </div> |
|
26 |
|
27 <pre id="test"> |
|
28 <script type="application/javascript"> |
|
29 |
|
30 /** Test for Bug 483651 **/ |
|
31 |
|
32 SimpleTest.waitForExplicitFinish(); |
|
33 |
|
34 function doTest() { |
|
35 var t1 = $("t1"); |
|
36 var editor = null; |
|
37 |
|
38 if (t1 instanceof Components.interfaces.nsIDOMNSEditableElement) |
|
39 editor = t1.editor; |
|
40 |
|
41 ok(editor, "able to get editor for the element"); |
|
42 t1.focus(); |
|
43 synthesizeKey("A", {}); |
|
44 synthesizeKey("VK_BACK_SPACE", {}); |
|
45 |
|
46 try { |
|
47 // Was the trailing br removed? |
|
48 is(editor.documentIsEmpty, true, "trailing <br> correctly removed"); |
|
49 } catch (e) { |
|
50 ok(false, "test failed with error "+e); |
|
51 } |
|
52 SimpleTest.finish(); |
|
53 } |
|
54 </script> |
|
55 </pre> |
|
56 |
|
57 <textarea id="t1" rows="2" columns="80"></textarea> |
|
58 </body> |
|
59 </html> |