Skip to content

Commit

Permalink
Auto merge of #18880 - emilio:fixup-parse-hack, r=emilio
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo committed Oct 14, 2017
2 parents 8b6207c + 6fbf006 commit de324f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions components/style/properties/declaration_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit de324f8

Please sign in to comment.