Files
serenity/Tests/LibWeb/Text/input/css/style-declaration-parent-rule.html
Andreas Kling da836c344a LibWeb: Implement CSSStyleDeclaration.parentRule
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).

(cherry picked from commit a12d28fd3053638ce6f4215bed2d8d45cda86375)
2024-06-26 23:07:42 +02:00

16 lines
546 B
HTML

<style>
span {
color: purple;
}
</style>
<script src="../include.js"></script>
<script>
test(() => {
const spanRule = document.styleSheets[0].cssRules[0];
println("spanRule: " + spanRule + " ~ " + spanRule.cssText);
println("spanRule.style: " + spanRule.style + " ~ " + spanRule.cssText);
println("spanRule.style.parentRule: " + spanRule.style.parentRule + " ~ " + spanRule.cssText);
println("spanRule.style.parentRule === spanRule: " + (spanRule.style.parentRule === spanRule));
});
</script>