|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <window title="Focus Scroll Tests" |
|
6 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
|
10 <script type="application/javascript" |
|
11 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
|
12 |
|
13 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
14 <div id="div" style="width:500px;height:48px;overflow:auto;font-size:16px;line-height:16px;"> |
|
15 aaaaaaaaa<br/>bbbbbbbb<br/> |
|
16 <a href="about:blank;" id="a">ccccccccc<br/>ddddddddd</a> |
|
17 </div> |
|
18 <p id="display"> |
|
19 </p> |
|
20 <div id="content" style="display: none"> |
|
21 </div> |
|
22 <pre id="test"> |
|
23 </pre> |
|
24 </body> |
|
25 |
|
26 <script> |
|
27 |
|
28 SimpleTest.waitForExplicitFinish(); |
|
29 |
|
30 function runTest() |
|
31 { |
|
32 var fm = Components.classes["@mozilla.org/focus-manager;1"]. |
|
33 getService(Components.interfaces.nsIFocusManager); |
|
34 var div = document.getElementById('div'); |
|
35 var a = document.getElementById('a'); |
|
36 synthesizeMouse(a, 4, 4, { type: "mousedown" }, window); |
|
37 is(fm.focusedElement, a, |
|
38 "The anchor element isn't set focus by the mouse down event"); |
|
39 is(div.scrollTop, 0, |
|
40 "The div element was scrolled by the mouse down event"); |
|
41 SimpleTest.finish(); |
|
42 } |
|
43 |
|
44 SimpleTest.waitForFocus(runTest); |
|
45 |
|
46 </script> |
|
47 |
|
48 </window> |