mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
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:
parent
a5139733cc
commit
3b15c303f6
Notes:
github-actions[bot]
2025-09-23 14:58:55 +00:00
Author: https://github.com/Calme1709
Commit: 3b15c303f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6281
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 48 additions and 40 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue