LibWeb: Move resolution of font weights and slopes to StyleValue

This isn't exactly ideal factoring (though I'm not sure what is) but
this will make it possible to reuse this code in the parser.
This commit is contained in:
Andreas Kling 2023-05-24 15:28:09 +02:00
commit be10360350
Notes: sideshowbarker 2024-07-17 05:13:53 +09:00
3 changed files with 63 additions and 50 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2023, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
@ -304,6 +304,9 @@ public:
virtual float to_integer() const { return 0; }
virtual ErrorOr<String> to_string() const = 0;
[[nodiscard]] int to_font_weight() const;
[[nodiscard]] int to_font_slope() const;
virtual bool equals(StyleValue const& other) const = 0;
bool operator==(StyleValue const& other) const