1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

LibWeb: Make serializing basic CSS types infallible

This commit is contained in:
Sam Atkins 2023-08-22 12:25:30 +01:00 committed by Sam Atkins
parent b5893ee115
commit 6bee81cfb6
38 changed files with 128 additions and 121 deletions

View file

@ -24,11 +24,11 @@ NonnullRefPtr<MediaQuery> MediaQuery::create_not_all()
ErrorOr<String> MediaFeatureValue::to_string() const
{
return m_value.visit(
[](ValueID const& ident) { return String::from_utf8(string_from_value_id(ident)); },
[](ValueID const& ident) { return MUST(String::from_utf8(string_from_value_id(ident))); },
[](Length const& length) { return length.to_string(); },
[](Ratio const& ratio) { return ratio.to_string(); },
[](Resolution const& resolution) { return resolution.to_string(); },
[](float number) { return String::number(number); });
[](float number) { return MUST(String::number(number)); });
}
bool MediaFeatureValue::is_same_type(MediaFeatureValue const& other) const