LibWeb: Implement CSSStyleDeclaration.parentRule

This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).
This commit is contained in:
Andreas Kling
2024-06-14 16:38:23 +02:00
committed by Andreas Kling
parent ec4d29849d
commit a12d28fd30
Notes: sideshowbarker 2024-07-18 03:23:00 +09:00
8 changed files with 55 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
<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>