summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dom/tests/mochitest/dom-level0/innerWidthHeight_script.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html b/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
new file mode 100644
index 0000000000..08f90111df
--- /dev/null
+++ b/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=320,height=320" />
+ <title>Bug 602580 - Test layout viewport and visual viewport sizes with meta tags and changed innerWidth</title>
+ <script class="testbody" type="text/javascript">
+ function runSubTest()
+ {
+ /* CSS viewport is set the by the meta tag in this document. */
+ window.opener.is(document.documentElement.clientWidth, 320, "CSS viewport width is meta viewport width");
+ window.opener.is(document.documentElement.clientHeight, 320, "CSS viewport height is meta viewport height");
+
+ /* Visual viewport values can be changed by setting window.innerWidth and innerHeight. */
+ var oldWidth = window.innerWidth;
+ var oldHeight = window.innerHeight;
+
+ window.innerWidth = 300;
+ window.opener.is(window.innerWidth, 300, "visual viewport width returns set value");
+ window.innerWidth = oldWidth;
+
+ window.innerHeight = 300;
+ window.opener.is(window.innerHeight, 300, "visual viewport height returns set value");
+ window.innerHeight = oldHeight;
+
+ window.opener.finish();
+ }
+ </script>
+</head>
+<body onload="runSubTest()">
+</body>
+</html>