Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta name="viewport" content="width=320,height=320" /> |
michael@0 | 5 | <title>Bug 602580 - Test getting and setting innerWidth and Height after using setCSSViewport</title> |
michael@0 | 6 | <script class="testbody" type="text/javascript"> |
michael@0 | 7 | function runSubTest() |
michael@0 | 8 | { |
michael@0 | 9 | // Firefox doesn't support the metaviewport tag on desktop, so we force |
michael@0 | 10 | // css viewport here using nsIDomWindowUtils |
michael@0 | 11 | var cwu = SpecialPowers.getDOMWindowUtils(window); |
michael@0 | 12 | cwu.setCSSViewport(320, 320); |
michael@0 | 13 | |
michael@0 | 14 | var oldWidth = window.innerWidth; |
michael@0 | 15 | var oldHeight = window.innerHeight; |
michael@0 | 16 | |
michael@0 | 17 | /* Test that return values are now from viewport */ |
michael@0 | 18 | window.opener.is(window.innerWidth, 320, "innerWidth is css viewport width"); |
michael@0 | 19 | window.opener.is(window.innerHeight, 320, "innerHeight is css viewport height"); |
michael@0 | 20 | |
michael@0 | 21 | window.innerWidth = 300; |
michael@0 | 22 | window.opener.is(window.innerWidth, 300, "innerWidth returns value that was set"); |
michael@0 | 23 | window.innerWidth = oldWidth; |
michael@0 | 24 | |
michael@0 | 25 | window.innerHeight = 300; |
michael@0 | 26 | window.opener.is(window.innerHeight, 300, "innerHeight returns value that was set"); |
michael@0 | 27 | window.innerHeight = oldHeight; |
michael@0 | 28 | |
michael@0 | 29 | window.opener.finish(); |
michael@0 | 30 | } |
michael@0 | 31 | </script> |
michael@0 | 32 | </head> |
michael@0 | 33 | <body onload="runSubTest()"> |
michael@0 | 34 | </body> |
michael@0 | 35 | </html> |