4 https://bugzilla.mozilla.org/show_bug.cgi?id=1394758
7 <title>Test for Bug1394758
</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=1394758">Mozilla Bug
1394758</a>
16 <div id=
"editable" contenteditable=
"true">
17 <span id=
"span" contenteditable=
"false">
24 <script type=
"application/javascript">
26 /** Test for Bug
611182 **/
27 SimpleTest.waitForExplicitFinish();
28 SimpleTest.waitForFocus(function() {
29 var editable = document.getElementById(
"editable");
30 var span = document.getElementById(
"span");
31 var beforeSpan = span.textContent;
34 window.getSelection().collapse(span.nextSibling,
0);
36 synthesizeKey(
"KEY_ArrowRight");
37 synthesizeKey(
"KEY_ArrowRight");
38 synthesizeKey(
"KEY_ArrowRight");
39 synthesizeKey(
"KEY_Backspace");
40 synthesizeKey(
"KEY_Backspace");
42 is(span.textContent, beforeSpan,
43 "VK_BACK_SPACE should not modify non-editable area");
44 is(span.nextSibling.textContent.trim(),
"rld",
45 "VK_BACK_SPACE should delete first 2 characters");
47 synthesizeKey(
"KEY_Delete");
49 is(span.textContent, beforeSpan,
50 "VK_DELETE should not modify non-editable area");
51 is(span.nextSibling.textContent.trim(),
"ld",
52 "VK_DELETE should delete first character");