|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="UTF-8"> |
|
5 <title>Test for Bug 919437</title> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 </head> |
|
9 <body> |
|
10 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=919437">Mozilla Bug 919437</a> |
|
11 <div id="content" style="display: none"></div> |
|
12 <pre id="test"> |
|
13 <script type="application/javascript"> |
|
14 /** Test for Bug 919437 **/ |
|
15 |
|
16 SimpleTest.waitForExplicitFinish(); |
|
17 |
|
18 function run() |
|
19 { |
|
20 var oldWidth = window.innerWidth; |
|
21 var oldHeight = window.innerHeight; |
|
22 var newWidth = oldWidth / 2; |
|
23 var newHeight = oldHeight / 2; |
|
24 |
|
25 var utils = SpecialPowers.getDOMWindowUtils(window); |
|
26 utils.setScrollPositionClampingScrollPortSize(newWidth, newHeight); |
|
27 is(window.innerWidth, newWidth, "innerWidth not updated to scroll port width"); |
|
28 is(window.innerHeight, newHeight, "innerHeight not updated to scroll port height"); |
|
29 |
|
30 window.innerWidth = oldWidth; |
|
31 window.innerHeight = oldHeight; |
|
32 is(window.innerWidth, newWidth, "innerWidth clobbered by direct set"); |
|
33 is(window.innerHeight, newHeight, "innerHeight clobbered by direct set"); |
|
34 |
|
35 SimpleTest.finish(); |
|
36 } |
|
37 |
|
38 window.addEventListener("load", run, false); |
|
39 |
|
40 </script> |
|
41 </pre> |
|
42 </body> |
|
43 </html> |