Bug 1772588 [wpt PR 34302] - [wpt] Add test for block-in-inline offsetParent., a...
[gecko.git] / editor / libeditor / tests / test_bug596506.html
blob3ecf5e2363bd827a44d69432996d89412cae9cc2
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=596506
5 -->
6 <head>
7 <title>Test for Bug 596506</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <script src="/tests/SimpleTest/EventUtils.js"></script>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=596506">Mozilla Bug 596506</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
17 </div>
18 <pre id="test">
19 <script type="application/javascript">
21 /** Test for Bug 596506 **/
23 SimpleTest.waitForExplicitFinish();
24 SimpleTest.waitForFocus(runTest);
26 const kIsMac = navigator.platform.includes("Mac");
29 function runTest() {
30 var edit = document.getElementById("edit");
31 edit.focus();
33 sendString("First");
34 synthesizeKey("KEY_Enter");
35 sendString("Second");
36 synthesizeKey("KEY_ArrowUp");
37 synthesizeKey("KEY_ArrowUp");
38 if (kIsMac) {
39 synthesizeKey("KEY_ArrowRight", { accelKey: true });
40 } else {
41 synthesizeKey("KEY_End");
43 sendString("ly");
44 is(edit.value, "Firstly\nSecond",
45 "Pressing end should position the cursor before the terminating newline");
46 SimpleTest.finish();
49 </script>
50 </pre>
52 <textarea id="edit"></textarea>
54 </body>
55 </html>