Skip to content

Truly independent web browser

771 B
Raw Blame
<!doctype html>
<div id="target" data-url="https://does-not-exist.test/404.png"></div>
<div id="source" data-url="https://does-not-exist.test/inherited.png">
    <div id="inherited-target"></div>
</div>
<script src="../include.js"></script>
<script>
    test(() => {
        const inheritedTarget = document.getElementById("inherited-target");

        target.style.setProperty("--x", "attr(data-url)");
        target.style.backgroundImage = "image-set(var(--x))";
        println(`direct: ${getComputedStyle(target).backgroundImage}`);

        source.style.setProperty("--x", "attr(data-url)");
        inheritedTarget.style.backgroundImage = "image-set(var(--x))";
        println(`inherited: ${getComputedStyle(inheritedTarget).backgroundImage}`);
    });
</script>