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:
Callum Law 2025-10-16 01:30:31 +13:00 committed by Tim Ledbetter
parent 9651969708
commit 2af071380e
Notes: github-actions[bot] 2025-10-16 09:28:36 +00:00
5 changed files with 28 additions and 6 deletions

View file

@ -181,8 +181,6 @@ void CSSImportRule::set_style_sheet(GC::Ref<CSSStyleSheet> style_sheet)
m_style_sheet = style_sheet;
m_style_sheet->set_owner_css_rule(this);
m_document->style_computer().load_fonts_from_sheet(*m_style_sheet);
if (m_parent_style_sheet) {
for (auto owning_document_or_shadow_root : m_parent_style_sheet->owning_documents_or_shadow_roots())
m_style_sheet->add_owning_document_or_shadow_root(*owning_document_or_shadow_root);