diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-14 09:49:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-14 09:49:45 -0500 |
commit | de324f8b18a9728bbcd6c0874840262d0002bc23 (patch) | |
tree | 8fea882b6d9f6764d0a28f1f3d184d0448e7c768 | |
parent | 8b6207c0d689b0eff27965a60c8acfb9ad34252c (diff) | |
parent | 6fbf0066805bd28b0fbc48140603703695f66621 (diff) | |
download | servo-de324f8b18a9728bbcd6c0874840262d0002bc23.tar.gz servo-de324f8b18a9728bbcd6c0874840262d0002bc23.zip |
Auto merge of #18880 - emilio:fixup-parse-hack, r=emilio
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.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18880)
<!-- Reviewable:end -->
-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; + } } } |