1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09: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:
Aliaksandr Kalenik 2025-01-10 20:00:43 +03:00 committed by Alexander Kalenik
parent 24e374d7e1
commit 98691810b1
Notes: github-actions[bot] 2025-01-13 22:04:04 +00:00
9 changed files with 103 additions and 43 deletions

View file

@ -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);
}
}