From 6fbf0066805bd28b0fbc48140603703695f66621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 14 Oct 2017 15:28:10 +0200 Subject: [PATCH] style: Fixup the hack added in #18867. The declaration can indeed have the same id if it contains variables, or is a CSS keyword value. This was making a WPT test fail, so this is tested, though Servo's WPT import didn't catch this for some reason. --- components/style/properties/declaration_block.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index e951d25897df..06e75a0a0937 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -509,13 +509,10 @@ impl PropertyDeclarationBlock { if let PropertyDeclaration::Display(old_display) = *slot { use properties::longhands::display::computed_value::T as display; - let new_display = match declaration { - PropertyDeclaration::Display(new_display) => new_display, - _ => unreachable!("How could the declaration id be the same?"), - }; - - if display::should_ignore_parsed_value(old_display, new_display) { - return false; + if let PropertyDeclaration::Display(new_display) = declaration { + if display::should_ignore_parsed_value(old_display, new_display) { + return false; + } } }