OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> |
| 5 description("Test that loading of SVG that contains a font data URL completes be
fore <img> and <body> onload handler is called, and thus doesn't cause assertion
failure."); |
| 6 jsTestIsAsync = true; |
| 7 |
| 8 var count = 0; |
| 9 function doTest() { |
| 10 var svg = document.getElementById('img'); |
| 11 var canvas = document.createElement("canvas"); |
| 12 var ctx = canvas.getContext("2d"); |
| 13 ctx.drawImage(svg, 0, 0); |
| 14 |
| 15 // Test finishes when both <body> and <img>'s onload() are called. |
| 16 ++count; |
| 17 if (count == 2) { |
| 18 finishJSTest(); |
| 19 } |
| 20 } |
| 21 </script> |
| 22 </head> |
| 23 <body onload="debug('onload of body'); doTest()"> |
| 24 <img src="resources/data-font-in-css-invalid-font.svg" id="img" onload="debug('o
nload of img'); doTest()"> |
| 25 </body> |
| 26 </html> |
OLD | NEW |