1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

LibWeb: Add missing Formatters for CSS dimension types

This commit is contained in:
Sam Atkins 2022-07-27 11:41:31 +01:00 committed by Andreas Kling
parent 9d0dccaa3f
commit ef2469bfed
4 changed files with 44 additions and 0 deletions

View file

@ -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());
}
};