This commit is contained in:
Simon Sapin 2017-03-08 16:53:21 +01:00 committed by Manish Goregaokar
parent 83c820e5b1
commit 765be69780
4 changed files with 10 additions and 9 deletions

View file

@ -288,10 +288,15 @@ impl PropertyDeclarationBlock {
}
let important_count = &mut self.important_count;
let mut removed_at_least_one = false;
let longhands = &mut self.longhands;
self.declarations.retain(|&(ref declaration, importance)| {
let remove = declaration.id().is_or_is_longhand_of(property);
let id = declaration.id();
let remove = id.is_or_is_longhand_of(property);
if remove {
removed_at_least_one = true;
if let PropertyDeclarationId::Longhand(id) = id {
longhands.remove(id)
}
if importance.important() {
*important_count -= 1
}
@ -299,9 +304,8 @@ impl PropertyDeclarationBlock {
!remove
});
if let PropertyId::Longhand(id) = *property {
if let PropertyId::Longhand(_) = *property {
debug_assert!(removed_at_least_one);
self.longhands.remove(id);
}
removed_at_least_one
}