diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index fc9c2eb66002..35a38d5ed144 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -258,6 +258,11 @@ impl Stylist { debug!("Found valid keyframe animation: {:?}", animation); self.animations.insert(keyframes_rule.name.clone(), animation); + } else { + // If there's a valid keyframes rule, even if it doesn't + // produce an animation, should shadow other animations + // with the same name. + self.animations.remove(&keyframes_rule.name); } } // We don't care about any other rule.