CSS parsing error types: flatten nested enums more still

This commit is contained in:
Simon Sapin 2017-10-09 18:15:18 +02:00
parent 1a041084ce
commit c36ac69d48
6 changed files with 49 additions and 88 deletions

View file

@ -1079,9 +1079,9 @@ impl<'a, 'b, 'i> DeclarationParser<'i> for PropertyDeclarationParser<'a, 'b> {
Ok(id) => id,
Err(()) => {
return Err(input.new_custom_error(if is_non_mozilla_vendor_identifier(&name) {
PropertyDeclarationParseErrorKind::UnknownVendorProperty
StyleParseErrorKind::UnknownVendorProperty
} else {
PropertyDeclarationParseErrorKind::UnknownProperty(name)
StyleParseErrorKind::UnknownProperty(name)
}));
}
};
@ -1125,9 +1125,7 @@ pub fn parse_property_declaration_list<R>(context: &ParserContext,
// If the unrecognized property looks like a vendor-specific property,
// silently ignore it instead of polluting the error output.
if let ParseErrorKind::Custom(
StyleParseErrorKind::PropertyDeclaration(
PropertyDeclarationParseErrorKind::UnknownVendorProperty)) = error.kind {
if let ParseErrorKind::Custom(StyleParseErrorKind::UnknownVendorProperty) = error.kind {
continue;
}