mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-17 21:49:42 +00:00
LibWeb: Move to_font_slope
from StyleValue
to FontStyleStyleValue
This method only operated on `FontStyleStyleValue`s anyway so this is a better place to have it
This commit is contained in:
parent
425b7de44a
commit
10793aef56
Notes:
github-actions[bot]
2025-09-19 09:07:50 +00:00
Author: https://github.com/Calme1709
Commit: 10793aef56
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 33 additions and 26 deletions
|
@ -151,25 +151,4 @@ GC::Ref<CSSStyleValue> StyleValue::reify(JS::Realm& realm, String const& associa
|
|||
return CSSStyleValue::create(realm, associated_property, to_string(SerializationMode::Normal));
|
||||
}
|
||||
|
||||
int StyleValue::to_font_slope() const
|
||||
{
|
||||
// FIXME: Implement oblique <angle>
|
||||
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);
|
||||
return normal_slope;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue