ladybird/Tests/LibWeb/Text/input/css/style-declaration-parent-rule.html
Andreas Kling a12d28fd30 LibWeb: Implement CSSStyleDeclaration.parentRule
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).
2024-06-14 20:45:37 +02:00

15 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>