Skip to content

Truly independent web browser

1.1 KB
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="../../work-test.js"></script>
<style>
    li {
        color: rgb(12, 34, 56);
    }
</style>
<ul id="list"></ul>
<script>
    test(() => {
        const list = document.getElementById("list");
        const work = styleWork(() => {
            for (let i = 0; i < 10; ++i) {
                const item = document.createElement("li");
                // Keep the originating styles distinct while leaving their inherited
                // groups identical, which gives every marker the same complete input.
                item.style.width = `${i}px`;
                item.textContent = `item ${i}`;
                list.appendChild(item);
            }
        });

        // FIXME: Nine of the ten identical markers should take the first one's record, but the style engine
        //        shares no pseudo-element record. The style trace lists the items, not their markers.
        println(work.text.trimEnd());
        println(`PASS: every marker inherited its color: ${[...list.children].every(item => getComputedStyle(item, "::marker").color === "rgb(12, 34, 56)")}`);
    });
</script>