|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=400204 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 400204</title> |
|
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
10 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=400204">Mozilla Bug 400204</a> |
|
13 <p id="display"></p> |
|
14 <iframe id="content" src="about:blank" style="display: none"></iframe> |
|
15 <pre id="test"> |
|
16 <script class="testbody" type="text/javascript"> |
|
17 var c = document.getElementById("content"); |
|
18 var success = false; |
|
19 // try to access innerWidth |
|
20 try { success = (c.contentWindow.innerWidth == 0); } catch(ex) { success = false; } |
|
21 ok(success, "can't access hidden iframe innerWidth, or it's not 0"); |
|
22 |
|
23 // try to access innerHeight |
|
24 success = false; |
|
25 try { success = (c.contentWindow.innerHeight == 0); } catch(ex) { success = false; } |
|
26 ok(success, "can't access hidden iframe innerHeight, or it's not 0"); |
|
27 |
|
28 // try to set innerWidth |
|
29 success = false; |
|
30 try { c.contentWindow.innerWidth = 100; success = true; } catch(ex) { success = false; } |
|
31 ok(success, "can't set hidden iframe innerWidth"); |
|
32 |
|
33 // try to set innerHeight |
|
34 success = false; |
|
35 try { c.contentWindow.innerHeight = 100; success = true; } catch(ex) { success = false; } |
|
36 ok(success, "can't set hidden iframe innerHeight"); |
|
37 |
|
38 // now try these again for good measure, and to ensure the values |
|
39 // haven't changed |
|
40 // try to access innerWidth |
|
41 success = false; |
|
42 try { success = (c.contentWindow.innerWidth == 0); } catch(ex) { success = false; } |
|
43 ok(success, "can't access hidden iframe innerWidth, or it's not 0"); |
|
44 |
|
45 // try to access innerHeight |
|
46 success = false; |
|
47 try { success = (c.contentWindow.innerHeight == 0); } catch(ex) { success = false; } |
|
48 ok(success, "can't access hidden iframe innerHeight, or it's not 0"); |
|
49 </script> |
|
50 </pre> |
|
51 </body> |
|
52 </html> |