<body>
    <p>Test CanvasRenderingContext2D.drawImage() can draw an SVGImageElement.</p>
    <canvas id="canvas"></canvas>
    <svg style="position: absolute; top: -999999px">
        <image id="source" href="resources/background.png" height="32" width="32" />
    </svg>
    <script>
        const image = document.getElementById("source");
        image.addEventListener("load", (e) => {
            const canvas = document.getElementById("canvas");
            const ctx = canvas.getContext("2d");
            ctx.imageSmoothingEnabled = false;
            ctx.drawImage(image, 0, 0, image.width.baseVal.value, image.height.baseVal.value, 0, 0, canvas.width, canvas.height)
        });
    </script>
</body>
