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