LibWeb: Use correct spacing when serializing media features

Previously, there was no space between the media feature name and value.
This commit is contained in:
Tim Ledbetter 2024-04-17 07:48:30 +01:00 committed by Andreas Kling
parent 398ae75f9a
commit a2cccf9420
2 changed files with 7 additions and 7 deletions

View file

@ -1,15 +1,15 @@
@media screen {
}
@media screen and ((min-width:20px) and (max-width:40px)) {
@media screen and ((min-width: 20px) and (max-width: 40px)) {
}
@media screen and (min-resolution:1dppx) {
@media screen and (min-resolution: 1dppx) {
}
@media screen and (min-resolution:2dppx) {
@media screen and (min-resolution: 2dppx) {
}
@media screen and (min-resolution:2.54dppx) {
@media screen and (min-resolution: 2.54dppx) {
}

View file

@ -64,11 +64,11 @@ String MediaFeature::to_string() const
case Type::IsTrue:
return MUST(String::from_utf8(string_from_media_feature_id(m_id)));
case Type::ExactValue:
return MUST(String::formatted("{}:{}", string_from_media_feature_id(m_id), m_value->to_string()));
return MUST(String::formatted("{}: {}", string_from_media_feature_id(m_id), m_value->to_string()));
case Type::MinValue:
return MUST(String::formatted("min-{}:{}", string_from_media_feature_id(m_id), m_value->to_string()));
return MUST(String::formatted("min-{}: {}", string_from_media_feature_id(m_id), m_value->to_string()));
case Type::MaxValue:
return MUST(String::formatted("max-{}:{}", string_from_media_feature_id(m_id), m_value->to_string()));
return MUST(String::formatted("max-{}: {}", string_from_media_feature_id(m_id), m_value->to_string()));
case Type::Range:
if (!m_range->right_comparison.has_value())
return MUST(String::formatted("{} {} {}", m_range->left_value.to_string(), comparison_string(m_range->left_comparison), string_from_media_feature_id(m_id)));