mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +00:00
LibWeb: Add CSS::Size::to_string() and an AK::Formatter for it
This commit is contained in:
parent
fdc9dc5729
commit
fce1c673c7
2 changed files with 30 additions and 0 deletions
|
@ -63,6 +63,8 @@ public:
|
|||
return m_length_percentage.length();
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
Size(Type type, LengthPercentage);
|
||||
|
||||
|
@ -71,3 +73,11 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct AK::Formatter<Web::CSS::Size> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::Size const& size)
|
||||
{
|
||||
return Formatter<StringView>::format(builder, size.to_string());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue