canvas-drawImage-no-width-or-height.html (639B)
1 <!DOCTYPE HTML> 2 <html class="reftest-wait"> 3 <script src="svg-image-util.js"></script> 4 <style> 5 canvas { 6 background: blue; 7 } 8 </style> 9 <body> 10 <script> 11 let viewBoxes = [null, "0 0 50 50", "0 0 50 20"]; 12 let promises = []; 13 for (viewBox of viewBoxes) { 14 // Without a given width or height the svg should be sized as if a width 15 // of 300px and height of 150px were given. 16 promises.push(generateCanvasDrawImageSVG("350", "200", null, null, viewBox)); 17 } 18 Promise.all(promises).then(() => { document.documentElement.className = "" }); 19 </script> 20 <!-- Body gets populated by script --> 21 </body> 22 </html>