mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb: Clamp negative font-size when loading font
`font-size` can end up with a negative value - either due to `calc` being resolved using the old method which doesn't clamp the value, or interpolation - in this case we should clamp negative values to zero. Gains us 36 new WPT passes and fixes crashes in the three imported tests.
This commit is contained in:
parent
39dc604642
commit
56c4e8199b
Notes:
github-actions[bot]
2025-09-01 11:30:15 +00:00
Author: https://github.com/Calme1709
Commit: 56c4e8199b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5941
Reviewed-by: https://github.com/AtkinsSJ ✅
9 changed files with 456 additions and 40 deletions
|
@ -1989,6 +1989,10 @@ RefPtr<Gfx::FontCascadeList const> StyleComputer::compute_font_for_style_values(
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: Font size can end up being negative due to interpolation - we can remove this once we correctly handle interpolation clamping.
|
||||
if (font_size_in_px < 0)
|
||||
font_size_in_px = 0;
|
||||
|
||||
auto slope = font_style.to_font_slope();
|
||||
|
||||
// FIXME: Implement the full font-matching algorithm: https://www.w3.org/TR/css-fonts-4/#font-matching-algorithm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue