diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-03-11 12:53:32 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-11 15:53:35 +0100 |
commit | 332799fbcbd97f2be5ea9afef9d2f1cd3c2b090b (patch) | |
tree | e1a982190dfbbd08ab4b3362598e1a0f7a3f9049 /Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | |
parent | 870b835115bf9008a56a2a2eb6a95a6873701830 (diff) | |
download | serenity-332799fbcbd97f2be5ea9afef9d2f1cd3c2b090b.zip |
LibWeb: Stub getting the initial font instead of the root one
Previously this queried the root layout-node's font, which was both
wrong and could crash if the layout wasn't ready yet. Now, it's just
wrong. But at least all the font-related wrongness is grouped together
in StyleComputer. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index d1152f31e1..393918b348 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -908,6 +908,12 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele style.set_computed_font(found_font.release_nonnull()); } +Gfx::Font const& StyleComputer::initial_font() const +{ + // FIXME: This is not correct. + return StyleProperties::font_fallback(false, false); +} + void StyleComputer::absolutize_values(StyleProperties& style, DOM::Element const*, Optional<CSS::Selector::PseudoElement>) const { auto viewport_rect = document().browsing_context()->viewport_rect(); |