3 https://bugzilla.mozilla.org/show_bug.cgi?id=1619852
7 <title>Test for Bug
1619852</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=1619852">Bug
1619852</a>
15 <div id=
"content" style=
"display: none"></div>
17 <div contenteditable
>abcd
</div>
19 SimpleTest
.waitForExplicitFinish();
20 SimpleTest
.waitForFocus(() => {
21 let editor
= document
.querySelector("div[contenteditable]");
22 // Do nothing, but `HTMLEditor` may use different path to detect unexpected DOM tree or selection change.
23 editor
.addEventListener("DOMNodeRemoved", () => {});
24 getSelection().collapse(editor
.firstChild
, 4);
25 synthesizeKey("KEY_Backspace");
26 is(editor
.textContent
, "abc", "The last character should've been removed by the Backspace");
27 getSelection().collapse(editor
.firstChild
, 1);
28 synthesizeKey("KEY_Backspace");
29 is(editor
.textContent
, "bc", "The first character should've been removed by the Backspace");