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:
parent
24e374d7e1
commit
98691810b1
Notes:
github-actions[bot]
2025-01-13 22:04:04 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 98691810b1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3217
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/tcl3
9 changed files with 103 additions and 43 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue