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/. -->
7 https://bugzilla.mozilla.org/show_bug.cgi?id=578771
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>
18 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=578771">Mozilla Bug
578771</a>
20 <div id=
"content" style=
"display: none">
24 <script type=
"application/javascript">
26 /** Test for Bug
578771 **/
27 SimpleTest.waitForExplicitFinish();
29 function testElem(elem, elemTag) {
30 var ce = document.getElementById(
"ce");
33 synthesizeMouse(elem,
5,
5, {clickCount:
2 });
34 ok(elem.selectionStart ==
0 && elem.selectionEnd ==
7,
35 " Double-clicking on another " + elemTag +
" works correctly");
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);
47 function startTest() {
48 var input = document.getElementById(
"ip");
49 testElem(input,
"input");
51 var textarea = document.getElementById(
"ta");
52 testElem(textarea,
"textarea");
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>