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.
15 lines
442 B
HTML
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>
|