Load event must be fired only for the SVG structurally external elements and the...
[WebKit-https.git] / LayoutTests / svg / custom / image-load-event.html
1 <body>
2     <svg width="100" height="100">
3         <image width="100%" height="100%"/>
4     </svg>
5     <div id="log"></div>
6     <script>
7         function loadImage(href) {
8             return new Promise((resolve) => {
9                 let image = document.querySelector('image');
10                 image.onload = (() => {
11                     resolve();
12                 });
13                 image.setAttribute("href", href);
14             });
15         }
16
17         if (window.testRunner)
18             testRunner.waitUntilDone();
19
20         loadImage("resources/green-checker.png").then(() => {
21             loadImage("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='green'/></svg>").then(() => {
22                 if (window.testRunner)
23                     testRunner.notifyDone();
24             });
25         });
26     </script>
27 </body>