Truly independent web browser
<!DOCTYPE html>
<script src="../../include.js"></script>
<style>
input::placeholder { color: rgb(255, 0, 0); }
input.flag::placeholder { color: rgb(0, 128, 0); }
</style>
<input id="field" placeholder="hint">
<script>
test(() => {
internals.updateStyle();
for (const step of [1, 2]) {
// Only the host's ::placeholder rules flip: the element backing it restyles as its own row.
field.classList.toggle("flag");
internals.updateStyle();
println(`step ${step}: ${getComputedStyle(field, "::placeholder").color}`);
}
});
</script>