LibWeb: Use computed line-height for FontMetrics

We were already doing this within `compute_property_values` where
we resolved most relative lengths but the remainder was instead
incorrectly using the font's line-spacing
This commit is contained in:
Callum Law 2025-09-23 00:18:51 +12:00 committed by Tim Ledbetter
commit 3b15c303f6
Notes: github-actions[bot] 2025-09-23 14:58:55 +00:00
6 changed files with 48 additions and 40 deletions

View file

@ -203,7 +203,7 @@ MatchResult MediaFeature::compare(HTML::Window const& window, MediaFeatureValue
auto const& initial_font = window.associated_document().style_computer().initial_font();
Gfx::FontPixelMetrics const& initial_font_metrics = initial_font.pixel_metrics();
Length::FontMetrics font_metrics { CSSPixels { initial_font.point_size() }, initial_font_metrics };
Length::FontMetrics font_metrics { CSSPixels { initial_font.point_size() }, initial_font_metrics, InitialValues::line_height() };
left_px = left_length.to_px(viewport_rect, font_metrics, font_metrics);
right_px = right_length.to_px(viewport_rect, font_metrics, font_metrics);