mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb/CSS: Extract SerializationMode into its own header
Prep for using this to serialize dimension types, and perhaps other things in the future.
This commit is contained in:
parent
2748522924
commit
eec4365542
Notes:
github-actions[bot]
2025-05-17 06:54:49 +00:00
Author: https://github.com/AtkinsSJ
Commit: eec4365542
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4783
Reviewed-by: https://github.com/tcl3 ✅
26 changed files with 112 additions and 99 deletions
|
@ -22,6 +22,7 @@
|
|||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/CSS/Keyword.h>
|
||||
#include <LibWeb/CSS/Length.h>
|
||||
#include <LibWeb/CSS/SerializationMode.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -385,10 +386,6 @@ public:
|
|||
virtual Color to_color(Optional<Layout::NodeWithStyle const&>) const { return {}; }
|
||||
Keyword to_keyword() const;
|
||||
|
||||
enum class SerializationMode {
|
||||
Normal,
|
||||
ResolvedValue,
|
||||
};
|
||||
virtual String to_string(SerializationMode) const = 0;
|
||||
|
||||
[[nodiscard]] int to_font_weight() const;
|
||||
|
@ -432,6 +429,6 @@ template<>
|
|||
struct AK::Formatter<Web::CSS::CSSStyleValue> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::CSSStyleValue const& style_value)
|
||||
{
|
||||
return Formatter<StringView>::format(builder, style_value.to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal));
|
||||
return Formatter<StringView>::format(builder, style_value.to_string(Web::CSS::SerializationMode::Normal));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue