Skip to content

Truly independent web browser

1.3 KB
Raw Blame
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="../../expected/visual-context/anchor-page-clip-frame-swap-keeps-sibling-captures-ref.html">
<style>
    body { margin: 0; }
    #anchor { anchor-name: --a; width: 20px; height: 20px; background: gray; }
    #target { position: absolute; position-anchor: --a; top: anchor(bottom); left: anchor(left); width: 20px; height: 20px; background: gray; }
    .box { position: absolute; top: 100px; width: 100px; height: 100px; }
    .img { background-image: linear-gradient(green, green); }
    #a { left: 0; }
    #b { left: 150px; }
    #c { left: 300px; }
    #d { left: 450px; }
</style>
<div id="anchor"></div>
<div id="target"></div>
<div id="a" class="box img"></div>
<div id="b" class="box img"></div>
<div id="c" class="box img"></div>
<div id="d" class="box"></div>
<script>
    requestAnimationFrame(() => requestAnimationFrame(() => {
        document.getElementById("a").classList.remove("img");
        document.getElementById("d").classList.add("img");
        requestAnimationFrame(() => requestAnimationFrame(() => {
            if (window.internals)
                internals.signalTestIsDone("PASS");
            else
                document.documentElement.classList.remove("reftest-wait");
        }));
    }));
</script>
</html>