4 https://bugzilla.mozilla.org/show_bug.cgi?id=1581337
7 <title>Test for Bug
1581337</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1581337">Mozilla Bug
1581337</a>
16 <div id=
"editor" contenteditable
><span _moz_quote=
"true">foo bar
</span></div>
19 SimpleTest
.waitForExplicitFinish();
20 SimpleTest
.waitForFocus(() => {
21 let editor
= document
.getElementById("editor");
23 let selection
= document
.getSelection();
24 selection
.collapse(editor
.firstChild
.firstChild
, 4);
25 synthesizeKey("KEY_Backspace");
26 // FYI: `_moz_quote` attribute is ignored at serializing HTML content.
27 is(editor
.innerHTML
, "<span>foobar</span>", "Backspace should delete the previous whitespace");
28 synthesizeKey("KEY_Delete");
29 is(editor
.innerHTML
, "<span>fooar</span>", "Delete should delete the next character, \"b\"");