diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 5dc5d207f36..75d05836972 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -1347,7 +1347,6 @@ impl<'a, 'b, 'i> DeclarationParser<'i> for PropertyDeclarationParser<'a, 'b> { let id = match PropertyId::parse(&name, self.context) { Ok(id) => id, Err(..) => { - self.last_parsed_property_id = None; return Err(input.new_custom_error(StyleParseErrorKind::UnknownProperty(name))); }, }; @@ -1469,6 +1468,10 @@ pub fn parse_property_declaration_list( match declaration { Ok(importance) => { block.extend(iter.parser.declarations.drain(), importance); + // We've successfully parsed a declaration, so forget about + // `last_parsed_property_id`. It'd be wrong to associate any + // following error with this property. + iter.parser.last_parsed_property_id = None; }, Err((error, slice)) => { iter.parser.declarations.clear();