Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && display == 'wayland'
- Manifest: xpfe/appshell/test/chrome.toml
<?xml version="1.0"?>
type="text/css"?>
<!--
-->
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2070008">Mozilla Bug 2070008</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
add_task(async function test_independent_window_respects_xul_position() {
const kX = 132;
const kY = 97;
let win = Services.ww.openWindow(
null,
"window_bug2070008.xhtml",
null,
"chrome,dialog=no,resizable",
null
);
await new Promise(resolve => {
win.addEventListener("load", resolve, { once: true });
});
// The screenX/Y attributes are in desktop pixels, but window.screenX/Y are
// in CSS pixels.
let cssToDesktopScale = win.devicePixelRatio / win.desktopToDeviceScale;
is(Math.round(win.screenX * cssToDesktopScale), kX,
"Independent window should respect the requested screenX");
is(Math.round(win.screenY * cssToDesktopScale), kY,
"Independent window should respect the requested screenY");
win.close();
});
]]>
</script>
</window>