style: Avoid trying to serialize 'all' with stuff that isn't variable references or CSS wide keywords

All is special, and that'd cause an error later on.

Differential Revision: https://phabricator.services.mozilla.com/D115132
This commit is contained in:
Emilio Cobos Álvarez 2023-05-21 21:30:15 +02:00 committed by Oriol Brufau
parent dd28d22cee
commit 4bcf4573db

View file

@ -1537,6 +1537,11 @@ impl ShorthandId {
return None; return None;
} }
if self == ShorthandId::All {
// 'all' only supports variables and CSS wide keywords.
return None;
}
// Check whether all declarations can be serialized as part of shorthand. // Check whether all declarations can be serialized as part of shorthand.
if declarations3.all(|d| d.may_serialize_as_part_of_shorthand()) { if declarations3.all(|d| d.may_serialize_as_part_of_shorthand()) {
return Some(AppendableValue::DeclarationsForShorthand(self, declarations)); return Some(AppendableValue::DeclarationsForShorthand(self, declarations));