mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibWeb: Fix insert/delete rule invalidation for adopted style sheets
Invalidation for adopted style sheets was broken because we had an assumption that "active" style sheet is always attached to StyleSheetList which is not true for adopted style sheets. This change addresses that by keeping track of all documents/shadow roots that own a style sheet and notifying them about invalidation instead of going through the StyleSheetList.
This commit is contained in:
committed by
Alexander Kalenik
parent
24e374d7e1
commit
98691810b1
@@ -139,10 +139,7 @@ void CSSStyleRule::set_selector_text(StringView selector_text)
|
||||
|
||||
m_selectors = parsed_selectors.release_value();
|
||||
if (auto* sheet = parent_style_sheet()) {
|
||||
if (auto style_sheet_list = sheet->style_sheet_list()) {
|
||||
style_sheet_list->document().style_computer().invalidate_rule_cache();
|
||||
style_sheet_list->document_or_shadow_root().invalidate_style(DOM::StyleInvalidationReason::SetSelectorText);
|
||||
}
|
||||
sheet->invalidate_owners(DOM::StyleInvalidationReason::SetSelectorText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user