diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-07-27 11:41:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-27 17:03:55 +0200 |
commit | ef2469bfed7f2afff9e7da8eb9d1e4c68ca39bbd (patch) | |
tree | 41cc150192f1f838337d1ca613bb34d2a077f4d8 /Userland/Libraries/LibWeb/CSS/Frequency.h | |
parent | 9d0dccaa3f0ea7ad8c50f74d8e8eee9308d5a524 (diff) | |
download | serenity-ef2469bfed7f2afff9e7da8eb9d1e4c68ca39bbd.zip |
LibWeb: Add missing Formatters for CSS dimension types
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Frequency.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Frequency.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Frequency.h b/Userland/Libraries/LibWeb/CSS/Frequency.h index c71cc67a1a..0c0c326549 100644 --- a/Userland/Libraries/LibWeb/CSS/Frequency.h +++ b/Userland/Libraries/LibWeb/CSS/Frequency.h @@ -7,6 +7,7 @@ #pragma once #include <AK/RefPtr.h> +#include <AK/String.h> #include <LibWeb/Forward.h> namespace Web::CSS { @@ -50,4 +51,13 @@ private: float m_value { 0 }; RefPtr<CalculatedStyleValue> m_calculated_style; }; + } + +template<> +struct AK::Formatter<Web::CSS::Frequency> : Formatter<StringView> { + ErrorOr<void> format(FormatBuilder& builder, Web::CSS::Frequency const& frequency) + { + return Formatter<StringView>::format(builder, frequency.to_string()); + } +}; |