test_bug741266.html (1369B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=741266 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 741266</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=741266">Mozilla Bug 741266</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 741266 */ 22 SimpleTest.waitForExplicitFinish(); 23 24 var url = URL.createObjectURL(new Blob([""], { type: "text/html" })); 25 var w = window.open(url, "", "width=100,height=100"); 26 w.onload = function() { 27 is(w.innerHeight, 100, "Popup height should be 100 when opened with window.open"); 28 // XXXbz On at least some platforms, the innerWidth is off by the scrollbar 29 // width for some reason. So just make sure it's the same for both popups. 30 var width = w.innerWidth; 31 w.close(); 32 33 w = document.open(url, "", "width=100,height=100"); 34 w.onload = function() { 35 is(w.innerHeight, 100, "Popup height should be 100 when opened with document.open"); 36 is(w.innerWidth, width, "Popup width should be the same when opened with document.open"); 37 w.close(); 38 SimpleTest.finish(); 39 }; 40 }; 41 </script> 42 </pre> 43 </body> 44 </html>