style: Make PropertyId::parse less of a footgun.

Bug: 1466095
Reviewed-by: xidorn
MozReview-Commit-ID: 2BmtSDPmHj9
This commit is contained in:
Emilio Cobos Álvarez 2018-06-01 14:00:57 +02:00
parent 5db1387f39
commit 600f19540e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 44 additions and 26 deletions

View file

@ -315,12 +315,12 @@ impl Declaration {
let mut input = ParserInput::new(&self.0);
let mut input = Parser::new(&mut input);
input
.parse_entirely(|input| -> Result<(), CssParseError<()>> {
input.parse_entirely(|input| -> Result<(), CssParseError<()>> {
let prop = input.expect_ident_cloned().unwrap();
input.expect_colon().unwrap();
let id = PropertyId::parse(&prop).map_err(|_| input.new_custom_error(()))?;
let id = PropertyId::parse(&prop, context)
.map_err(|_| input.new_custom_error(()))?;
let mut declarations = SourcePropertyDeclaration::new();
input.parse_until_before(Delimiter::Bang, |input| {