4 https://bugzilla.mozilla.org/show_bug.cgi?id=358033
7 <title>Test for Bug
358033</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=358033">Mozilla Bug
358033</a>
16 <input type=
"text" id=
"input1">
20 SimpleTest
.waitForExplicitFinish();
21 SimpleTest
.waitForFocus(function() {
22 let input
= document
.getElementById("input1");
24 input
.value
= "ABC DEF";
26 input
.setSelectionRange(4, 7, "backward");
27 synthesizeKey("KEY_Backspace");
28 is(input
.value
, "ABC ", "KEY_Backspace should remove selected string");
29 synthesizeKey("Z", { accelKey
: true });
30 is(input
.value
, "ABC DEF", "Undo should restore string");
31 synthesizeKey("KEY_ArrowLeft", { shiftKey
: true });
32 synthesizeKey("KEY_ArrowLeft", { shiftKey
: true });
33 synthesizeKey("KEY_Backspace");
35 is(input
.value
, "AB", "anchor node and focus node should be kept order after undo");