summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
blob: 7406086ad77e25b4ba39b9891ff31e18a96ac9ff (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
<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=320,height=320" />
  <title>Bug 602580 - Test getting and setting innerWidth and Height after using setCSSViewport</title>
  <script class="testbody" type="text/javascript">
  function runSubTest()
  {
    var oldWidth = window.innerWidth;
    var oldHeight = window.innerHeight;

    /* Test that return values are now from viewport */
    window.opener.is(window.innerWidth, 320, "innerWidth is css viewport width");
    window.opener.is(window.innerHeight, 320, "innerHeight is css viewport height");

    window.innerWidth = 300;
    window.opener.is(window.innerWidth, 300, "innerWidth returns value that was set");
    window.innerWidth = oldWidth;

    window.innerHeight = 300;
    window.opener.is(window.innerHeight, 300, "innerHeight returns value that was set");
    window.innerHeight = oldHeight;

    window.opener.finish();
  }
  </script>
</head>
<body onload="runSubTest()">
</body>
</html>