blob: 08f90111dfc31027221f8189779488f28be48548 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>
|