Bug 594140. Make window.open width/height parameters respect opener's CSS-pixel-to-device-pixel ratio. r=tnikkel,a=jst
authorRobert O'Callahan <roc@ocallahan.org>
Thu, 09 Sep 2010 22:17:13 -0700
changeset 52357 008a0b8578db0f30975cf3028cb10543e8577339
parent 52356 5a9dc4ef07364c48a6d762755bbc20715f12b07b
child 52358 64ef0bd8c70d1b3984554b301a86b2139c532330
push idunknown
push userunknown
push dateunknown
reviewerstnikkel, jst
bugs594140
milestone2.0b6pre
Bug 594140. Make window.open width/height parameters respect opener's CSS-pixel-to-device-pixel ratio. r=tnikkel,a=jst
embedding/test/test_window_open_units.html
new file mode 100644
--- /dev/null
+++ b/embedding/test/test_window_open_units.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test for Bug 594140</title>
+  <script type="text/javascript" src="/MochiKit/packed.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594140">Mozilla Bug 594140</a>
+<p id="display"></p>
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+var viewer =
+  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+               .getInterface(Components.interfaces.nsIWebNavigation)
+               .QueryInterface(Components.interfaces.nsIDocShell)
+               .contentViewer
+               .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
+viewer.fullZoom = 2;
+
+var w = window.open("about:blank", "", "width=200,height=100");
+is(w.innerWidth, 400, "wrong width");
+is(w.innerHeight, 200, "wrong height");
+w.close();
+
+viewer.fullZoom = 1;
+
+</script>
+</pre>
+</body>
+</html>