Skip to content

Truly independent web browser

978 B
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="../../work-test.js"></script>
<style id="sheet">
    ol { list-style-type: stars; }
    .moved { color: rgb(0, 128, 0); }
</style>
<ol><li id="item">item</li></ol>
<div id="plain">plain</div>
<script>
    // A counter style reaches only the records that resolved one. An unrelated rule change in the
    // same update still reaches its element, as does the change to the list item naming the style.
    test(() => {
        const work = styleWork(() => {
            document.getElementById("sheet").sheet.insertRule("@counter-style stars { system: cyclic; symbols: '*'; }");
            plain.classList.add("moved");
            item.classList.add("moved");
        });
        println(`changed records: [${work.changed().map(shortStyleName).join(", ")}]`);
        println(`plain color: ${getComputedStyle(plain).color}`);
        println(`item color: ${getComputedStyle(item).color}`);
    });
</script>