LibWeb/CSS: Take AbstractElement in font computation methods

This commit is contained in:
Sam Atkins 2025-09-09 11:55:45 +01:00 committed by Alexander Kalenik
parent 263c51f6ac
commit 64c3319147
Notes: github-actions[bot] 2025-09-11 16:48:19 +00:00
4 changed files with 24 additions and 28 deletions

View file

@ -103,9 +103,9 @@ public:
auto font_list = font_source.visit(
[&](DOM::Document* document) -> RefPtr<Gfx::FontCascadeList const> {
if constexpr (SameAs<CanvasType, HTML::HTMLCanvasElement>) {
return document->style_computer().compute_font_for_style_values(&canvas_element, {}, font_family, font_size, font_style, font_weight, font_width);
return document->style_computer().compute_font_for_style_values(DOM::AbstractElement { canvas_element, {} }, font_family, font_size, font_style, font_weight, font_width);
} else {
return document->style_computer().compute_font_for_style_values(nullptr, {}, font_family, font_size, font_style, font_weight, font_width);
return document->style_computer().compute_font_for_style_values({}, font_family, font_size, font_style, font_weight, font_width);
}
},
[](HTML::WorkerGlobalScope*) -> RefPtr<Gfx::FontCascadeList const> {