LibWeb: Don't serialize shorthand with non-uniform CSS-wide keywords

This commit is contained in:
Callum Law 2025-06-11 15:25:28 +12:00 committed by Sam Atkins
commit f8f4da3b90
Notes: github-actions[bot] 2025-06-16 11:39:06 +00:00
5 changed files with 253 additions and 9 deletions

View file

@ -61,8 +61,12 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const
}
});
if (all_same_keyword && built_in_keyword.has_value())
return MUST(String::from_utf8(string_from_keyword(built_in_keyword.value())));
if (built_in_keyword.has_value()) {
if (all_same_keyword)
return MUST(String::from_utf8(string_from_keyword(built_in_keyword.value())));
return ""_string;
}
auto default_to_string = [&]() {
auto all_properties_same_value = true;