From eae348bccb9b27a38d0fb52d2ffb76eb4b5c5752 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 8 Mar 2017 13:35:40 -0800 Subject: [PATCH] servo: Merge #15872 - Fix debug assertion failure in gecko CI (from servo:dedup); r=emilio a=merge Source-Repo: https://github.com/servo/servo Source-Revision: 2565242665645e6a218f138e2b95d5a29f296104 MozReview-Commit-ID: Kd6ZOrODsGg --HG-- extra : source : 2e536a204cec3d485c8861a4bcca96324e3b7ae1 --- servo/components/style/properties/declaration_block.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/servo/components/style/properties/declaration_block.rs b/servo/components/style/properties/declaration_block.rs index 2cb5cba48745..f10da7a7cb41 100644 --- a/servo/components/style/properties/declaration_block.rs +++ b/servo/components/style/properties/declaration_block.rs @@ -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 }