ladybird/Tests/LibWeb/Text/input/css/element-reference-pseudo-stale.html
Callum Law 199e82fc73 LibWeb: Forward non-synthetic pseudo-elt accesses to relevant element
This adds a new class `ElementReferencePseudoElement` which forwards
any accesses to the referenced element for "element-reference" pseudo
elements.

This allows us to, for instance:
 - Access the underlying `ComputedProperties` in getComputedStyle, which
   includes inline style.
 - Store and access `CustomPropertyData`
 - Access the layout node for "resolved value" computation
 - Apply animations from `update_animated_style_if_needed`

We register these with the originating element when calling
`set_associated_shadow_host_pseudo_element`, this requires us to append
the element to the tree beforehand since we need to be able to get the
shadow host.
2026-05-21 14:26:22 +01:00

15 lines
442 B
HTML

<!doctype html>
<style>
input[type="text"]::placeholder {
color: green;
}
</style>
<input id="target" type="text" placeholder="placeholder" />
<script src="../include.js"></script>
<script>
test(() => {
println(`before change: ${getComputedStyle(target, "::placeholder").color}`);
target.type = "file";
println(`after change: ${getComputedStyle(target, "::placeholder").color}`);
});
</script>