Skip to content

Truly independent web browser

1.1 KB
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<style>
    details > summary:first-of-type { color: rgb(255, 0, 0); }
    .dirty { background-color: rgb(0, 128, 0); }
</style>
<div id="root"></div>
<script>
    test(() => {
        const root = document.getElementById("root");
        const details = document.createElement("details");
        details.innerHTML = `<summary>first</summary><summary>target</summary>`;
        root.appendChild(details);
        const first = details.firstElementChild;
        const target = details.lastElementChild;
        internals.updateStyle();
        println(`initial: ${getComputedStyle(target).display}, ${getComputedStyle(target).color}`);

        first.remove();
        internals.updateStyle();
        println(`incremental: ${getComputedStyle(target).display}, ${getComputedStyle(target).color}`);

        internals.setUserStyle("/* force complete style */");
        internals.updateStyle();
        println(`cold: ${getComputedStyle(target).display}, ${getComputedStyle(target).color}`);
        internals.setUserStyle("");
    });
</script>