Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / editor / libeditor / tests / test_bug578771.html
blob5cf7b23e5250307177a11ee900c3c113c6813d6f
1 <!DOCTYPE HTML>
2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
3 - License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 - You can obtain one at http://mozilla.org/MPL/2.0/. -->
5 <html>
6 <!--
7 https://bugzilla.mozilla.org/show_bug.cgi?id=578771
8 -->
10 <head>
11 <title>Test for Bug 578771</title>
12 <script src="/tests/SimpleTest/SimpleTest.js"></script>
13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
14 <script src="/tests/SimpleTest/EventUtils.js"></script>
15 </head>
17 <body>
18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=578771">Mozilla Bug 578771</a>
19 <p id="display"></p>
20 <div id="content" style="display: none">
21 </div>
23 <pre id="test">
24 <script type="application/javascript">
26 /** Test for Bug 578771 **/
27 SimpleTest.waitForExplicitFinish();
29 function testElem(elem, elemTag) {
30 var ce = document.getElementById("ce");
31 ce.focus();
33 synthesizeMouse(elem, 5, 5, {clickCount: 2 });
34 ok(elem.selectionStart == 0 && elem.selectionEnd == 7,
35 " Double-clicking on another " + elemTag + " works correctly");
37 ce.focus();
38 synthesizeMouse(elem, 5, 5, {clickCount: 3 });
39 ok(elem.selectionStart == 0 && elem.selectionEnd == 14,
40 "Triple-clicking on another " + elemTag + " works correctly");
42 // Avoid platform selection differences
43 SimpleTest.waitForFocus(function() {
44 SpecialPowers.pushPrefEnv({"set": [["layout.word_select.eat_space_to_next_word", false]]}, startTest);
45 });
47 function startTest() {
48 var input = document.getElementById("ip");
49 testElem(input, "input");
51 var textarea = document.getElementById("ta");
52 testElem(textarea, "textarea");
54 SimpleTest.finish();
56 </script>
57 </pre>
59 <input id="ip" type="text" value="Mozilla editor" />
60 <textarea id="ta">Mozilla editor</textarea>
61 <div id="ce" contenteditable="true">Contenteditable div that could interfere with focus</div>
62 </body>
63 </html>