Skip to content

Truly independent web browser

1.5 KB
Raw Blame
<!DOCTYPE html>
<script src="../include.js"></script>
<div
    id="target"
    style="
        width: 1px;
        height: 1px;
        background-image: url('../wpt-import/images/anim-gr.gif');
    "
></div>
<script>
    const imageURL = new URL("../wpt-import/images/anim-gr.gif", document.location).href;

    asyncTest(done => {
        window.addEventListener("load", () => {
            internals.dumpLayoutTree(document);
            const isAnimatingBeforeBaseChange =
                internals.imageAnimationStateForURL(imageURL).isAnimating;

            const beforeBaseChange = getComputedStyle(target).backgroundImage.replace(imageURL, "[image-url]");
            const base = document.createElement("base");
            base.href = "../wpt-import/";
            document.head.append(base);
            const afterBaseChange = getComputedStyle(target).backgroundImage.replace(imageURL, "[image-url]");

            internals.dumpLayoutTree(document);
            const isAnimatingAfterBaseChange =
                internals.imageAnimationStateForURL(imageURL).isAnimating;

            println(
                `Computed URL before base change: ${beforeBaseChange}`
            );
            println(`Computed URL after base change: ${afterBaseChange}`);
            println(
                `timer active before base change: ${isAnimatingBeforeBaseChange}`
            );
            println(
                `timer active after base change: ${isAnimatingAfterBaseChange}`
            );
            done();
        });
    });
</script>