Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / editor / libeditor / tests / test_bug1394758.html
blobd1560e5092c3a77978e1b1f7060d813cbeab7f6a
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1394758
5 -->
6 <head>
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"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1394758">Mozilla Bug 1394758</a>
14 <p id="display"></p>
15 <div id="content">
16 <div id="editable" contenteditable="true">
17 <span id="span" contenteditable="false">
18 Hello
19 </span>
20 World
21 </div>
22 </div>
23 <pre id="test">
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;
33 editable.focus();
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");
54 SimpleTest.finish();
55 });
57 </script>
58 </pre>
59 </body>
60 </html>