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:
Callum Law 2025-09-02 22:41:48 +12:00 committed by Sam Atkins
commit 10793aef56
Notes: github-actions[bot] 2025-09-19 09:07:50 +00:00
6 changed files with 33 additions and 26 deletions

View file

@ -52,6 +52,7 @@
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
#include <LibWeb/CSS/StyleValues/EasingStyleValue.h>
#include <LibWeb/CSS/StyleValues/FilterValueListStyleValue.h>
#include <LibWeb/CSS/StyleValues/FontStyleStyleValue.h>
#include <LibWeb/CSS/StyleValues/FrequencyStyleValue.h>
#include <LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h>
#include <LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h>
@ -1856,7 +1857,7 @@ RefPtr<Gfx::FontCascadeList const> StyleComputer::compute_font_for_style_values(
// FIXME: We round to int here as that is what is expected by our font infrastructure below
auto weight = round_to<int>(font_weight);
auto slope = font_style.to_font_slope();
auto slope = font_style.as_font_style().to_font_slope();
// FIXME: Implement the full font-matching algorithm: https://www.w3.org/TR/css-fonts-4/#font-matching-algorithm