diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-14 15:28:10 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-14 15:28:10 +0200 |
commit | 6fbf0066805bd28b0fbc48140603703695f66621 (patch) | |
tree | b0bbcc95f08a5f80da8e7b5ae61ecc53119bda40 | |
parent | 240c05f13b859fc87531555cfd59fa273503a1a7 (diff) | |
download | servo-6fbf0066805bd28b0fbc48140603703695f66621.tar.gz servo-6fbf0066805bd28b0fbc48140603703695f66621.zip |
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.
-rw-r--r-- | components/style/properties/declaration_block.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index e951d25897d..06e75a0a093 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; + } } } |