OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script> |
| 7 var t1 = async_test("Loading of SVG with a font with a invalid URL completes " + |
| 8 "before <img> load event and drawImage() doesn't crash."); |
| 9 var t2 = async_test("Loading of SVG with a font with a invalid URL completes " + |
| 10 "before <body> load event and drawImage() doesn't crash."); |
| 11 |
| 12 var imgOnLoadCalled = false; |
| 13 |
| 14 function doTest() { |
| 15 var svg = document.getElementById('img'); |
| 16 var canvas = document.createElement("canvas"); |
| 17 var ctx = canvas.getContext("2d"); |
| 18 ctx.drawImage(svg, 0, 0); |
| 19 } |
| 20 |
| 21 var imgOnLoad = t1.step_func_done(function() { |
| 22 imgOnLoadCalled = true; |
| 23 doTest(); |
| 24 }); |
| 25 |
| 26 var bodyOnLoad = t2.step_func_done(function() { |
| 27 assert_true(imgOnLoadCalled, |
| 28 "<img> load event must be fired before <body> load event"); |
| 29 doTest(); |
| 30 }); |
| 31 </script> |
| 32 </head> |
| 33 <body onload="bodyOnLoad()"> |
| 34 <img src="resources/data-font-in-css-invalid-data-url.svg" id="img" onload="imgO
nLoad()"> |
| 35 </body> |
| 36 </html> |
OLD | NEW |