Files
tubestation/widget/tests/window_bug593307_centerscreen.xhtml
Emilio Cobos Álvarez 6cde87d52b Bug 1872997 - Remove "fit to screen" code in cocoa widget. r=mac-reviewers,bradwerth
No other platform does this. This comes from bug 413277, but positioning
windows (in particular popups) partially offscreen is desirable in some
cases (e.g., when drawing non-native shadows).

We have protections in place to prevent content from doing things like
what caused this code to be added.

Remove a cocoa-specific test for this, and tweak another test which has
a dependent window opened from an offscreen window, and the offscreen
window positioning happens right after the load event.

The window ends up on screen even without that tweak.

Differential Revision: https://phabricator.services.mozilla.com/D197903
2024-01-08 19:46:13 +00:00

27 lines
813 B
HTML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window title="Mozilla Bug 593307"
width="100" height="100"
onload="onload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
<body xmlns="http://www.w3.org/1999/xhtml" id="body">
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
function onload()
{
var SimpleTest = window.opener.SimpleTest;
SimpleTest.ok(window.screenX >= 0, "centerscreen window should not start offscreen (X coordinate): " + window.screenX);
SimpleTest.ok(window.screenY >= 0, "centerscreen window should not start offscreen (Y coordinate): " + window.screenY);
window.opener.finished();
}
]]>
</script>
</window>