mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb: Cache the font in StyleComputer::initial_font()
This function is bogus, but it's still getting called a lot during media query evaluation, so let's at least cache the font instead of recreating it every single time.
This commit is contained in:
parent
07ff75bbec
commit
ea0bfda1b9
Notes:
github-actions[bot]
2025-06-11 14:26:40 +00:00
Author: https://github.com/awesomekling
Commit: ea0bfda1b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5059
1 changed files with 2 additions and 1 deletions
|
@ -2232,7 +2232,8 @@ void StyleComputer::compute_font(ComputedProperties& style, DOM::Element const*
|
|||
Gfx::Font const& StyleComputer::initial_font() const
|
||||
{
|
||||
// FIXME: This is not correct.
|
||||
return ComputedProperties::font_fallback(false, false, 12);
|
||||
static auto font = ComputedProperties::font_fallback(false, false, 12);
|
||||
return font;
|
||||
}
|
||||
|
||||
void StyleComputer::absolutize_values(ComputedProperties& style, GC::Ptr<DOM::Element const> element) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue