|
1 <?xml version="1.0"?> |
|
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 |
|
4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
|
5 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
6 |
|
7 <window id="window" title="Subframe Origin Tests" |
|
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
|
11 |
|
12 <iframe |
|
13 style="margin-left:20px; margin-top:20px; min-height:300px; max-width:300px; max-height:300px; border:solid 1px black;" |
|
14 src="frame_subframe_origin_subframe1.xul"></iframe> |
|
15 <caption id="parentcap" label=""/> |
|
16 |
|
17 <script> |
|
18 |
|
19 // Fire a mouse move event aimed at this window, and check to be |
|
20 // sure the client coords translate from widget to the dom correctly. |
|
21 |
|
22 function runTests() |
|
23 { |
|
24 synthesizeMouse(document.getElementById("window"), 1, 2, { type: "mousemove" }); |
|
25 } |
|
26 |
|
27 window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window); |
|
28 |
|
29 function mouseMove(e) { |
|
30 var element = e.target; |
|
31 var el = document.getElementById("parentcap"); |
|
32 el.label = "client: (" + e.clientX + "," + e.clientY + ")"; |
|
33 window.opener.wrappedJSObject.SimpleTest.is(e.clientX, 1, "mouse event clientX"); |
|
34 window.opener.wrappedJSObject.SimpleTest.is(e.clientY, 2, "mouse event clientY"); |
|
35 // fire the next test on the sub frame |
|
36 frames[0].runTests(); |
|
37 } |
|
38 |
|
39 window.addEventListener("mousemove",mouseMove, false); |
|
40 |
|
41 </script> |
|
42 </window> |