mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
style: Make PropertyId::parse less of a footgun.
Bug: 1466095 Reviewed-by: xidorn MozReview-Commit-ID: 2BmtSDPmHj9
This commit is contained in:
parent
5db1387f39
commit
600f19540e
5 changed files with 44 additions and 26 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue