Skip to content

Commit

Permalink
style: Fixup the hack added in #18867.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emilio committed Oct 14, 2017
1 parent 240c05f commit 6fbf006
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions components/style/properties/declaration_block.rs
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 6fbf006

Please sign in to comment.