Truly independent web browser
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="../expected/canvas-display-list-cache-update-ref.html">
<canvas id="canvas" height="100" width="100"></canvas>
<script>
const initialDataURL = canvas.toDataURL();
const offscreenCanvas = canvas.transferControlToOffscreen();
const context = offscreenCanvas.getContext("2d");
context.fillStyle = "rgb(0, 255, 0)";
context.fillRect(0, 0, 100, 100);
function waitForCommittedFrame() {
if (canvas.toDataURL() === initialDataURL) {
requestAnimationFrame(waitForCommittedFrame);
return;
}
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.documentElement.classList.remove("reftest-wait");
});
});
}
requestAnimationFrame(waitForCommittedFrame);
</script>
</html>