Turn CSSStyleRule into a CSSGroupingRule subclass (#36254)

Note that `StyleRule` may not have the `CssRules` readily available,
they may need to be created. So the previous approach of providing
`CSSGroupingRule` with the `CssRules` is no good: it would require
writing them in advance, just in case they end up being used.

Therefore, this removes the `CSSGroupingRule::rules` field. Instead,
they are lazily obtained in `CSSGroupingRule::rulelist()` by downcasting
and calling the appropriate method for the subclass.

Testing: covered by WPT
Fixes: #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-04-01 12:18:07 -07:00 committed by GitHub
parent dba8a0c22c
commit 0cdc1dcf72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 83 additions and 76 deletions

View file

@ -497,12 +497,6 @@
[CSSImportRule interface: sheet.cssRules[0\] must inherit property "supportsText" with the proper type]
expected: FAIL
[CSSStyleRule interface: existence and properties of interface object]
expected: FAIL
[CSSStyleRule interface: existence and properties of interface prototype object]
expected: FAIL
[CSSGroupingRule interface: sheet.cssRules[4\] must inherit property "cssRules" with the proper type]
expected: FAIL