LibWeb: Remove all font loaders linked to a StyleSheet when it's deleted

When a style sheet is removed, all font loaders created from that style
sheet should also be removed.
This commit is contained in:
Aliaksandr Kalenik 2024-09-22 18:10:46 +02:00 committed by Alexander Kalenik
commit 74588a0a16
Notes: github-actions[bot] 2024-09-22 18:11:26 +00:00
5 changed files with 35 additions and 3 deletions

View file

@ -123,6 +123,7 @@ void StyleSheetList::remove_sheet(CSSStyleSheet& sheet)
return;
}
m_document_or_shadow_root->document().style_computer().unload_fonts_from_sheet(sheet);
m_document_or_shadow_root->document().style_computer().invalidate_rule_cache();
document_or_shadow_root().invalidate_style(DOM::StyleInvalidationReason::StyleSheetListRemoveSheet);
}