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/. -->
7 https://bugzilla.mozilla.org/show_bug.cgi?id=471319
11 <title>Test for Bug
471319</title>
12 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
13 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
16 <body onload=
"doTest();">
17 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=471319">Mozilla Bug
471319</a>
19 <div id=
"content" style=
"display: none">
23 <script type=
"application/javascript">
25 /** Test for Bug
471319 **/
27 SimpleTest.waitForExplicitFinish();
30 let t1 = SpecialPowers.wrap($(
"t1"));
32 // Test
1: Undo on an empty editor - the editor should not forget about
33 // the padding
<br> element for empty editor.
34 let t1Editor = t1.editor;
36 // Did the editor recognize the new padding
<br> element?
38 ok(!t1.value,
"<br> still recognized as padding on undo");
41 // Test
2: Redo on an empty editor - the editor should not forget about
42 // the padding
<br> element for empty editor.
43 let t2 = SpecialPowers.wrap($(
"t2"));
44 let t2Editor = t2.editor;
46 // Did the editor recognize the new padding
<br> element?
48 ok(!t2.value,
"<br> still recognized as padding on redo");
51 // Test
3: Undoing a batched transaction where both end points of the
52 // transaction are the padding
<br> element for empty editor - the
53 //
<br> element should still be recognized as padding.
54 t1Editor.beginTransaction();
57 t1Editor.endTransaction();
60 "recreated <br> from undo transaction recognized as padding");
63 // Test
4: Redoing a batched transaction where both end points of the
64 // transaction are the padding
<br> element for empty editor - the
65 //
<br> element should still be recognized padding.
68 "recreated <br> from redo transaction recognized as padding");
74 <input type=
"text" id=
"t1" />
75 <input type=
"text" id=
"t2" />