mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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. :^)
This commit is contained in:
committed by
Andreas Kling
parent
870b835115
commit
332799fbcb
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/332799fbcb Pull-request: https://github.com/SerenityOS/serenity/pull/12997
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user