1205923-1.html (849B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <body> 4 </body> 5 <script> 6 function createImage(loadHandler) { 7 var newImage = new Image; 8 newImage.id = "thepreviewimage"; 9 newImage.setAttribute("src", "unsized-svg.svg"); 10 if (loadHandler) { 11 newImage.onload = loadHandler; 12 } 13 14 // Query width & height, and display them in document: 15 physWidth = newImage.width; 16 physHeight = newImage.height; 17 document.documentElement.innerHTML += 18 physWidth + " x " + physHeight + "<br>"; 19 } 20 21 function part2() { 22 // Load image again: 23 createImage(); 24 25 // End the crashtest. 26 document.documentElement.removeAttribute("class"); 27 } 28 29 function startTest() { 30 // Trigger image load, and call part2() when it's loaded: 31 createImage(part2); 32 } 33 34 startTest(); 35 </script> 36 </html>