Bug 1711189 - Avoid returning fmt::Errors for things that are not formatting errors.

They are not. The serialization code already checks if the result is
empty, which can happen for other reasons. This makes the code a bit
more resilient to misuse.

Differential Revision: https://phabricator.services.mozilla.com/D115133
This commit is contained in:
Emilio Cobos Álvarez 2021-05-14 10:45:04 +00:00
Родитель 1ba2a99de2
Коммит df834cf40d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -1486,13 +1486,13 @@ impl ShorthandId {
// shorthand, since it only accepts CSS-wide keywords (and
// variable references), which will be handled in
// get_shorthand_appendable_value.
Err(fmt::Error)
Ok(())
}
% for property in data.shorthands_except_all():
ShorthandId::${property.camel_case} => {
match shorthands::${property.ident}::LonghandsToSerialize::from_iter(declarations) {
Ok(longhands) => longhands.to_css(dest),
Err(_) => Err(fmt::Error)
Err(_) => Ok(())
}
},
% endfor