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
commit cef1cb6aa7
Notes: github-actions[bot] 2024-12-18 12:22:34 +00:00

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;
};