Skip to content

Truly independent web browser

537 B
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<style>
    input::placeholder { color: red; }
    input.changed::placeholder { color: green; }
</style>
<input id="input" placeholder="text">
<script>
    test(() => {
        // The element standing for the input's ::placeholder is cascaded from the input's rules.
        internals.updateStyle();
        input.classList.add("changed");
        internals.updateStyle();
        println(`placeholder color: ${getComputedStyle(input, "::placeholder").color}`);
    });
</script>