|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=572649 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 572649</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript" 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=572649">Mozilla Bug 572649</a> |
|
14 <p id="display"> |
|
15 <textarea id="area" rows="5"> |
|
16 Here |
|
17 is |
|
18 some |
|
19 very |
|
20 long |
|
21 text |
|
22 that |
|
23 we're |
|
24 using |
|
25 for |
|
26 testing |
|
27 purposes |
|
28 </textarea> |
|
29 </p> |
|
30 <div id="content" style="display: none"> |
|
31 |
|
32 </div> |
|
33 <pre id="test"> |
|
34 <script type="application/javascript"> |
|
35 |
|
36 /** Test for Bug 572649 **/ |
|
37 SimpleTest.waitForExplicitFinish(); |
|
38 addLoadEvent(function() { |
|
39 var area = document.getElementById("area"); |
|
40 |
|
41 is(area.scrollTop, 0, "The textarea should not be scrolled initially"); |
|
42 area.addEventListener("focus", function() { |
|
43 area.removeEventListener("focus", arguments.callee, false); |
|
44 setTimeout(function() { |
|
45 is(area.scrollTop, 0, "The textarea's insertion point should not be scrolled into view"); |
|
46 |
|
47 SimpleTest.finish(); |
|
48 }, 0); |
|
49 }, false); |
|
50 setTimeout(function() { |
|
51 var rect = area.getBoundingClientRect(); |
|
52 synthesizeMouse(area, rect.width - 5, 5, {}); |
|
53 }, 0); |
|
54 }); |
|
55 |
|
56 </script> |
|
57 </pre> |
|
58 </body> |
|
59 </html> |