mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb: Make FontCache per-StyleComputer
This effectively makes it per-Document, but we hang it off of StyleComputer since that's what it's used for. The purpose of this is to prevent downloaded fonts from escaping the context that loaded them. There's probably a more elegant solution where we still share caching of system fonts, but let's start here.
This commit is contained in:
parent
69a81243f5
commit
429b2e5860
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/awesomekling
Commit: 429b2e5860
Pull-request: https://github.com/SerenityOS/serenity/pull/20622
6 changed files with 13 additions and 13 deletions
|
@ -2222,7 +2222,7 @@ RefPtr<Gfx::Font const> StyleComputer::compute_font_for_style_values(DOM::Elemen
|
|||
return found_font;
|
||||
}
|
||||
|
||||
if (auto found_font = FontCache::the().get(font_selector))
|
||||
if (auto found_font = m_font_cache.get(font_selector))
|
||||
return found_font;
|
||||
|
||||
if (auto found_font = font_matching_algorithm(key, font_size_in_pt))
|
||||
|
@ -2296,7 +2296,7 @@ RefPtr<Gfx::Font const> StyleComputer::compute_font_for_style_values(DOM::Elemen
|
|||
}
|
||||
}
|
||||
|
||||
FontCache::the().set(font_selector, *found_font);
|
||||
m_font_cache.set(font_selector, *found_font);
|
||||
|
||||
return found_font;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue