Skip to content

Truly independent web browser

1.0 KB
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<style>
    #hidden { display: none; }
    #hidden-reaction.before { color: red; }
    #hidden-reaction.after { color: green; }
    #visible.before { background-color: red; }
    #visible.after { background-color: green; }
</style>
<div id="hidden"><span id="hidden-reaction" class="before"></span></div>
<span id="visible" class="before"></span>
<span id="query"></span>
<script>
    test(() => {
        const hiddenReaction = document.getElementById("hidden-reaction");
        const visible = document.getElementById("visible");
        const query = document.getElementById("query");
        internals.updateStyle();

        hiddenReaction.className = "after";
        getComputedStyle(query).color;
        internals.updateStyle();

        visible.className = "after";
        internals.updateStyle();

        println("visible color: " + getComputedStyle(visible).backgroundColor);
        println("hidden color: " + getComputedStyle(hiddenReaction).color);
    });
</script>