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=467442
7 <window title=
"Mozilla Bug 467442"
9 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
12 <!-- test code goes here -->
19 <button id=
"anchor" label=
"Anchor hello on here" style=
"transform: translate(100px, 0)"/>
21 <script type=
"application/javascript">
24 SimpleTest.waitForExplicitFinish();
27 /** Test for Bug
467442 **/
28 let panel = document.getElementById(
"panel");
29 let anchor = document.getElementById(
"anchor");
31 panel.addEventListener(
"popupshown", function onpopupshown() {
32 let panelRect = panel.getBoundingClientRect();
33 let marginLeft = parseFloat(getComputedStyle(panel).marginLeft);
34 let anchorRect = anchor.getBoundingClientRect();
35 is(panelRect.left - marginLeft, anchorRect.left,
"Panel should be anchored to the button");
36 panel.addEventListener(
"popuphidden", function onpopuphidden() {
42 panel.openPopup(anchor,
"after_start",
0,
0, false, false);
48 <!-- test results are displayed in the html:body -->
49 <body xmlns=
"http://www.w3.org/1999/xhtml">
50 <a href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=467442"
51 target=
"_blank">Mozilla Bug
467442</a>