LibWeb/CSS: Add Parser::Dimension::to_string()

This will be used when printing out unsupported dimensions inside calc,
for a more useful error message.
This commit is contained in:
Sam Atkins
2024-12-17 13:04:40 +00:00
parent f3a9bb0a91
commit cef1cb6aa7

View File

@@ -107,6 +107,11 @@ public:
return percentage();
}
String to_string() const
{
return m_value.visit([](auto const& it) { return it.to_string(); });
}
private:
Variant<Angle, Flex, Frequency, Length, Percentage, Resolution, Time> m_value;
};