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

@ -444,15 +444,11 @@ fn change_bits_for_longhand(longhand: LonghandId) -> WillChangeBits {
}
fn change_bits_for_maybe_property(ident: &str, context: &ParserContext) -> WillChangeBits {
let id = match PropertyId::parse(ident) {
let id = match PropertyId::parse(ident, context) {
Ok(id) => id,
Err(..) => return WillChangeBits::empty(),
};
if !id.allowed_in(context) {
return WillChangeBits::empty();
}
match id.as_shorthand() {
Ok(shorthand) => {
shorthand.longhands().fold(WillChangeBits::empty(), |flags, p| {