4 https://bugzilla.mozilla.org/show_bug.cgi?id=1649005
7 <meta charset=
"UTF-8" />
8 <title>Test for bug
1649005</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
11 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
13 /** Test for bug 1649005, bug 1779343 **/
14 window
.addEventListener("DOMContentLoaded", () => {
15 SimpleTest
.waitForExplicitFinish();
16 SimpleTest
.waitForFocus(function() {
17 document
.body
.textContent
= ""; // It would be \n\n otherwise...
18 synthesizeMouseAtCenter(document
.body
, {});
20 var editor
= getEditor();
21 is(document
.body
.textContent
, "", "Initial body check");
23 is(document
.body
.textContent
, "", "Initial body check after rewrap");
25 document
.body
.innerHTML
= ">abc<br/>>def<br/>>ghi";
27 is(document
.body
.textContent
, "> abc def ghi", "Rewrapped");
29 document
.body
.innerHTML
= "> ";
31 is(document
.body
.textContent
, "> ", "Rewrapped half-empty string");
37 function getEditor() {
38 var Ci
= SpecialPowers
.Ci
;
39 var editingSession
= SpecialPowers
.wrap(window
).docShell
.editingSession
;
40 var editor
= editingSession
.getEditorForWindow(window
);
41 editor
.QueryInterface(Ci
.nsIHTMLEditor
);
42 editor
.QueryInterface(Ci
.nsIEditorMailSupport
);
43 editor
.flags
|= SpecialPowers
.Ci
.nsIEditor
.eEditorPlaintextMask
;
48 <body contenteditable
></body>