replaced-element-017.html (654B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <title>CSS aspect-ratio: canvas</title> 4 <link rel="author" title="Mozilla" href="https://www.mozilla.org/"> 5 <link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio"> 6 <link rel="match" href="reference/ref-filled-green-100x20-rect.html" /> 7 8 <canvas width=200 height=200 style='width:100px; aspect-ratio:5/1;'></canvas> 9 <script> 10 window.onload = function() { 11 const canvas = document.querySelector('canvas'); 12 const ctx = canvas.getContext('2d'); 13 ctx.fillStyle = 'green'; 14 ctx.fillRect(0, 0, 200, 200); 15 document.documentElement.removeAttribute('class'); 16 } 17 </script> 18 </html>