mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Fix font-style to slope conversion
In a recent refactor of font styles, the new FontStyleStyleValue was introduced; however, the `to_font_slope()` function was not changed to understand this new type. When it tries to convert such a font style to a keyword, it fails. We then rendered the wrong font-style.
This commit is contained in:
committed by
Sam Atkins
parent
d00d49ba2f
commit
b1ee539e9d
Notes:
github-actions[bot]
2025-05-22 16:40:16 +00:00
Author: https://github.com/lionkor 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b1ee539e9db Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4822 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -457,7 +457,21 @@ int CSSStyleValue::to_font_slope() const
|
||||
return oblique_slope;
|
||||
case Keyword::Normal:
|
||||
default:
|
||||
break;
|
||||
static int normal_slope = Gfx::name_to_slope("Normal"sv);
|
||||
return normal_slope;
|
||||
}
|
||||
} else if (is_font_style()) {
|
||||
switch (as_font_style().font_style()) {
|
||||
case FontStyle::Italic:
|
||||
static int italic_slope = Gfx::name_to_slope("Italic"sv);
|
||||
return italic_slope;
|
||||
case FontStyle::Oblique:
|
||||
static int oblique_slope = Gfx::name_to_slope("Oblique"sv);
|
||||
return oblique_slope;
|
||||
case FontStyle::Normal:
|
||||
default:
|
||||
static int normal_slope = Gfx::name_to_slope("Normal"sv);
|
||||
return normal_slope;
|
||||
}
|
||||
}
|
||||
static int normal_slope = Gfx::name_to_slope("Normal"sv);
|
||||
|
||||
Reference in New Issue
Block a user