LibWeb/CSS: Use CSSRule's context to parse new child rules

Keep track of which CSSRule owns a CSSRuleList, and then use that to
produce a stack of RuleContexts for the CSS Parser to use.

There are certainly other places we should do this!
This commit is contained in:
Sam Atkins 2025-04-14 17:27:00 +01:00
commit 658569b533
Notes: github-actions[bot] 2025-04-23 10:39:55 +00:00
7 changed files with 32 additions and 15 deletions

View file

@ -18,6 +18,7 @@ CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules, Type type
: CSSRule(realm, type)
, m_rules(rules)
{
m_rules->set_owner_rule(*this);
for (auto& rule : *m_rules)
rule->set_parent_rule(this);
}