test_bug392318.html (1271B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=392318 5 --> 6 <head> 7 <title>Test for Bug 392318</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 <script class="testbody" type="text/javascript"> 11 /** Test for Bug 392318 */ 12 13 SimpleTest.waitForExplicitFinish(); 14 var testRan = false; 15 16 function runTest() { 17 isnot($("t").offsetWidth, 0, "Unexpected offsetWidth"); 18 testRan = true; 19 } 20 21 document.addEventListener("DOMContentLoaded", runTest); 22 23 addLoadEvent(function() { 24 is(testRan, true, "Onload firing too early"); 25 }); 26 27 addLoadEvent(SimpleTest.finish); 28 </script> 29 <!-- IMPORTANT: This sheet must come after the test that sets up the 30 DOMContentLoaded handler and before the <body> --> 31 <link rel="stylesheet" type="text/css" href="data:text/css;%20charset=utf-8,%23t%20%7B%0Awidth%3A%20200px%3B%0Aborder%3A%201px%20solid%20black%3B%0Aheight%3A%20100px%3B%0A%7D"> 32 </head> 33 <body> 34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=392318">Mozilla Bug 392318</a> 35 <p id="display"></p> 36 <div id="content" style="display: none"> 37 38 </div> 39 <pre id="test"> 40 <div id="t"></div> 41 </pre> 42 </body> 43 </html>