2 <?xml-stylesheet type=
"text/css" href=
"chrome://global/skin"?>
3 <?xml-stylesheet type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"?>
5 https://bugzilla.mozilla.org/show_bug.cgi?id=835044
7 <window title=
"Mozilla Bug 835044"
9 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <script src=
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
13 <panel id=
"thepanel" level=
"parent"
14 onpopupshown=
"sendMouseEvent();"
15 onmousemove=
"checkCoords(event);"
16 width=
"80" height=
"80">
19 <!-- test results are displayed in the html:body -->
20 <body xmlns=
"http://www.w3.org/1999/xhtml">
21 <a href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=835044"
23 target=
"_blank">Mozilla Bug
835044</a>
26 <!-- test code goes here -->
27 <script type=
"application/javascript">
29 SimpleTest.waitForExplicitFinish();
31 let utils = window.windowUtils;
32 let panel = document.getElementById('thepanel');
35 function startTest() {
36 // This first event is to ensure that the next event will have different
37 // coordinates to the previous mouse position, and so actually generates
38 // mouse events. The mouse is not moved off the window, as that might
39 // move focus to another application.
40 synthesizeNativeMouseEvent({
42 screenX: window.mozInnerScreenX,
43 screenY: window.mozInnerScreenY,
44 scale:
"screenPixelsPerCSSPixelNoOverride",
45 elementOnWidget: window.documentElement,
48 panel.openPopup(document.getElementById(
"anchor"),
"after_start");
51 function sendMouseEvent() {
52 rect = panel.getBoundingClientRect();
53 synthesizeNativeMouseEvent({
61 function checkCoords(event) {
62 isfuzzy(event.clientX, rect.left +
1, window.windowUtils.screenPixelsPerCSSPixel,
"Motion x coordinate");
63 isfuzzy(event.clientY, rect.top +
2, window.windowUtils.screenPixelsPerCSSPixel,
"Motion y coordinate");