summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/dom-level0/innerWidthHeight_script.html')
-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>