1 <!DOCTYPE html> 2 <script text="text/javascript"> 3 function runtest() 4 { 5 var nick=document.getElementById('nick'); 6 var row=document.getElementById('the_table').insertRow(-1); 7 var result=row.insertCell(0); 8 if (nick.naturalWidth == 320 && nick.naturalHeight == 240) 9 result.innerHTML = "SUCCESS."; 10 else 11 result.innerHTML = "FAILURE!"; 12 if (window.layoutTestController) 13 layoutTestController.dumpAsText(); 14 } 15 </script> 16 <body onload="runtest()"> 17 <p>This test verifies that at the time a body onload function is 18 called that the subresources of this page (in particular the image) 19 are already loaded. The page verifies that the image has the expected 20 dimensions at the time of the onload event, and prints its result 21 based on that. This is a regression test for a bug introduced by the 22 patch for bug 3652.</p> 23 <img id=nick src="resources/nick.jpg"> 24 <table id="the_table" border="1"> 25 <tr><td></td></tr> 26 </table> 27 </body> 28