Bug 1867190 - Initialise the PHC allocate delay later r=glandium
[gecko.git] / layout / xul / test / test_popupZoom.xhtml
blob5e253744f9eacc207f0be1a527cdcabfacd8e1a4
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 <window title="XUL Panel zoom test"
5 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
6 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
7 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
9 <body xmlns="http://www.w3.org/1999/xhtml">
10 </body>
12 <script><![CDATA[
13 SimpleTest.waitForExplicitFinish();
15 var savedzoom;
17 function openPopup()
19 docviewer = window.docShell.docViewer;
20 savedzoom = SpecialPowers.getFullZoom(window);
21 SpecialPowers.setFullZoom(window, 2);
23 document.getElementById("panel").
24 openPopup(document.getElementById("anchor"), "after_start", 0, 0, false, false, null);
27 function popupShown(event)
29 var panel = document.getElementById("panel");
30 var panelMarginLeft = parseFloat(getComputedStyle(panel).marginLeft);
31 var panelMarginTop = parseFloat(getComputedStyle(panel).marginTop);
32 var panelbcr = panel.getBoundingClientRect();
33 var anchorbcr = document.getElementById("anchor").getBoundingClientRect();
35 ok(Math.abs(panelbcr.x - panelMarginLeft - anchorbcr.x) < 3, "x pos is correct");
36 ok(Math.abs(panelbcr.y - panelMarginTop - anchorbcr.bottom) < 3, "y pos is correct");
38 SpecialPowers.setFullZoom(window, savedzoom);
40 event.target.hidePopup();
43 SimpleTest.waitForFocus(openPopup);
44 ]]></script>
46 <description id="anchor" value="Sometext to this some texts"/>
47 <panel id="panel" onpopupshown="popupShown(event)" onpopuphidden="SimpleTest.finish()">
48 <resizer id="resizer" dir="bottomend" width="16" height="16"/>
49 <hbox width="50" height="50" flex="1"/>
50 </panel>
53 </window>