Bug 1867190 - Initialise the PHC allocate delay later r=glandium
[gecko.git] / layout / xul / test / test_bug467442.xhtml
blobf0f84c3f86141bfefdffdba52f6fdfc5cab783e3
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=467442
6 -->
7 <window title="Mozilla Bug 467442"
8 onload="onload()"
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 -->
13 <popupset>
14 <panel id="panel">
15 Hello.
16 </panel>
17 </popupset>
18 <hbox>
19 <button id="anchor" label="Anchor hello on here" style="transform: translate(100px, 0)"/>
20 </hbox>
21 <script type="application/javascript">
22 <![CDATA[
24 SimpleTest.waitForExplicitFinish();
26 function onload() {
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() {
37 SimpleTest.finish();
38 }, { once: true });
39 panel.hidePopup();
40 }, { once: true });
42 panel.openPopup(anchor, "after_start", 0, 0, false, false);
45 ]]>
46 </script>
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>
52 </body>
53 </window>