mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
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:
parent
17d6ab2416
commit
be10360350
3 changed files with 63 additions and 50 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue