Skip to content

Truly independent web browser

934 B
Raw Blame
<!DOCTYPE html>
<html>
    <style>
        #foo {
            math-depth: sibling-count();
        }

        #bar {
            math-depth: random(fixed 0.5, 0, 10);
        }

        #baz {
            math-depth: random(fixed calc(2 / 4), 0, 10);
        }

        #qux {
            math-depth: random(0, 10);
        }
    </style>
    <div id="foo"></div>
    <div id="bar"></div>
    <div id="baz"></div>
    <div id="qux"></div>
    <script src="../include.js"></script>
    <script>
        test(() => {
            internals.updateStyle();
            println(getComputedStyle(foo).mathDepth);
            println(getComputedStyle(bar).mathDepth);
            println(getComputedStyle(baz).mathDepth);
            const randomMathDepth = parseInt(getComputedStyle(qux).mathDepth);
            println(`element-cached value is in range: ${randomMathDepth >= 0 && randomMathDepth <= 10}`);
        });
    </script>
</html>