LibWeb: Invalidate owner sheet on add/remove in CSSStyleProperties

Fixes at least 2 WPT subtests.
This commit is contained in:
Andreas Kling 2025-04-24 14:25:50 +02:00 committed by Andreas Kling
parent fbb3b06462
commit cf34a7bb32
Notes: github-actions[bot] 2025-04-24 16:28:02 +00:00
6 changed files with 87 additions and 7 deletions

View file

@ -248,6 +248,11 @@ WebIDL::ExceptionOr<void> CSSStyleSheet::replace_sync(StringView text)
rules_without_import.append(rule);
}
// NOTE: The spec doesn't say where to set the parent style sheet, so we'll do it here.
for (auto& rule : rules_without_import) {
rule->set_parent_style_sheet(this);
}
// 4. Set sheets CSS rules to rules.
m_rules->set_rules({}, rules_without_import);