stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669).

This commit is contained in:
Josh Matthews 2017-07-06 13:59:31 -04:00
parent a08371e8eb
commit 0b43d0072c
21 changed files with 318 additions and 80 deletions

View file

@ -908,10 +908,17 @@ pub fn parse_one_declaration_into(declarations: &mut SourcePropertyDeclaration,
parsing_mode,
quirks_mode);
let mut input = ParserInput::new(input);
Parser::new(&mut input).parse_entirely(|parser| {
let mut parser = Parser::new(&mut input);
let start = parser.position();
parser.parse_entirely(|parser| {
PropertyDeclaration::parse_into(declarations, id, &context, parser)
.map_err(|e| e.into())
}).map_err(|_| ())
}).map_err(|err| {
let end = parser.position();
let error = ContextualParseError::UnsupportedPropertyDeclaration(
parser.slice(start..end), err);
log_css_error(&mut parser, start, error, &context);
})
}
/// A struct to parse property declarations.