Skip to content

Truly independent web browser

915 B
Raw Blame
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="../expected/canvas-display-list-cache-update-ref.html">
<style>
    canvas {
        width: 100px;
        height: 100px;
    }
</style>
<canvas id="canvas" height="50" width="50"></canvas>
<script>
    const context = canvas.getContext("2d");
    context.fillStyle = "rgb(255, 0, 0)";
    context.fillRect(0, 0, 50, 50);

    requestAnimationFrame(() => {
        requestAnimationFrame(() => {
            canvas.width = 100;
            canvas.height = 100;
            context.fillStyle = "rgb(0, 255, 0)";
            context.fillRect(0, 0, 100, 100);

            requestAnimationFrame(() => {
                if (window.internals)
                    internals.signalTestIsDone("PASS");
                else
                    document.documentElement.classList.remove("reftest-wait");
            });
        });
    });
</script>
</html>