mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWeb: Dont load a style sheet's fonts until it has an owning document
We need a style sheet to have an owning document to load it's fonts (to generate a length resolution context). Fixes #6445
This commit is contained in:
parent
9651969708
commit
2af071380e
Notes:
github-actions[bot]
2025-10-16 09:28:36 +00:00
Author: https://github.com/Calme1709
Commit: 2af071380e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6482
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 28 additions and 6 deletions
|
@ -31,7 +31,6 @@ GC::Ref<WebIDL::ObservableArray> create_adopted_style_sheets_list(Node& document
|
|||
return WebIDL::NotAllowedError::create(document_or_shadow_root.realm(), "Sharing a StyleSheet between documents is not allowed."_utf16);
|
||||
|
||||
style_sheet.add_owning_document_or_shadow_root(document_or_shadow_root);
|
||||
document_or_shadow_root.document().style_computer().load_fonts_from_sheet(style_sheet);
|
||||
document_or_shadow_root.document().style_computer().invalidate_rule_cache();
|
||||
document_or_shadow_root.invalidate_style(DOM::StyleInvalidationReason::AdoptedStyleSheetsList);
|
||||
return {};
|
||||
|
@ -43,7 +42,6 @@ GC::Ref<WebIDL::ObservableArray> create_adopted_style_sheets_list(Node& document
|
|||
auto& style_sheet = static_cast<CSS::CSSStyleSheet&>(object);
|
||||
|
||||
style_sheet.remove_owning_document_or_shadow_root(document_or_shadow_root);
|
||||
document_or_shadow_root.document().style_computer().unload_fonts_from_sheet(style_sheet);
|
||||
document_or_shadow_root.document().style_computer().invalidate_rule_cache();
|
||||
document_or_shadow_root.invalidate_style(DOM::StyleInvalidationReason::AdoptedStyleSheetsList);
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue