Skip to content

Truly independent web browser

1.0 KB
Raw Blame
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="../expected/svg-image-rescale-repaints-at-new-scale-ref.html">
<style>
    body { margin: 0; }
    img { display: block; width: 60px; }
</style>
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect width='60' height='60' fill='white'/%3E%3Ccircle cx='30' cy='30' r='24' fill='%23446'/%3E%3Crect x='26' y='6' width='8' height='48' fill='orange'/%3E%3C/svg%3E">
<script>
    // Painting the image at a larger CSS size re-records the SVG image document's display
    // list at a higher raster scale on its own arena, with no relayout and no commit in
    // between. The new recording must not splice command captures whose device-pixel
    // bytes were recorded at the previous scale.
    requestAnimationFrame(() => {
        requestAnimationFrame(() => {
            document.querySelector("img").style.width = "240px";
            document.documentElement.classList.remove("reftest-wait");
        });
    });
</script>
</html>