diff --git a/Libraries/LibWeb/CSS/CSSGroupingRule.cpp b/Libraries/LibWeb/CSS/CSSGroupingRule.cpp index 9f190779dd..bc1af9c7ad 100644 --- a/Libraries/LibWeb/CSS/CSSGroupingRule.cpp +++ b/Libraries/LibWeb/CSS/CSSGroupingRule.cpp @@ -52,12 +52,15 @@ WebIDL::ExceptionOr CSSGroupingRule::insert_rule(StringView rule, u32 index // AD-HOC: The spec doesn't say where to set the parent rule, so we'll do it here. m_rules->item(index)->set_parent_rule(this); + m_parent_style_sheet->invalidate_owners(DOM::StyleInvalidationReason::StyleSheetInsertRule); return index; } WebIDL::ExceptionOr CSSGroupingRule::delete_rule(u32 index) { - return m_rules->remove_a_css_rule(index); + TRY(m_rules->remove_a_css_rule(index)); + m_parent_style_sheet->invalidate_owners(DOM::StyleInvalidationReason::StyleSheetDeleteRule); + return {}; } void CSSGroupingRule::for_each_effective_rule(TraversalOrder order, Function const& callback) const diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-nesting/cssom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-nesting/cssom.txt index 747c82900f..d70326303a 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-nesting/cssom.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-nesting/cssom.txt @@ -2,8 +2,7 @@ Harness status: OK Found 14 tests -13 Pass -1 Fail +14 Pass Pass CSSStyleRule is a CSSGroupingRule Pass Simple CSSOM manipulation of subrules Pass Simple CSSOM manipulation of subrules 1 @@ -17,4 +16,4 @@ Pass Simple CSSOM manipulation of subrules 8 Pass Simple CSSOM manipulation of subrules 9 Pass Simple CSSOM manipulation of subrules 10 Pass Mutating the selectorText of outer rule invalidates inner rules -Fail Manipulation of nested declarations through CSSOM \ No newline at end of file +Pass Manipulation of nested declarations through CSSOM \ No newline at end of file