Skip to content

Truly independent web browser

960 B
Raw Blame
<!doctype html>
<style>
    iframe {
        width: 50px;
        height: 0px;
    }
</style>
<iframe
    id="iframe"
    srcdoc="
  <div id=target></div>
  <style>
    #target {
      order: calc(100vh / 1px);
    }
  </style>
"
></iframe>

<script src="../include.js"></script>
<script>
    asyncTest(async done => {
        while (!iframe.contentDocument?.querySelector("#target"))
            await new Promise(resolve => iframe.addEventListener("load", resolve, { once: true }));

        requestAnimationFrame(() => {
            requestAnimationFrame(() => {
                const target = iframe.contentDocument.querySelector("#target");

                println(getComputedStyle(target).order);

                for (let height of [1, 2, 3]) {
                    iframe.style.height = `${height}px`;
                    println(getComputedStyle(target).order);
                }

                done();
            });
        });
    });
</script>