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

@ -402,4 +402,13 @@ Optional<String> CSSStyleSheet::source_text(Badge<DOM::Document>) const
return m_source_text;
}
bool CSSStyleSheet::has_associated_font_loader(FontLoader& font_loader) const
{
for (auto& loader : m_associated_font_loaders) {
if (loader.ptr() == &font_loader)
return true;
}
return false;
}
}