From e3232f5c369d2ecdf8c591f2571306bb41bcd8ee Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Wed, 20 Sep 2017 15:59:04 +0900 Subject: [PATCH] Filter out !important property in keyframes for servo. --- components/style/animation.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/style/animation.rs b/components/style/animation.rs index e29236186c7..91146571589 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -481,11 +481,13 @@ fn compute_style_for_animation_step(context: &SharedStyleContext, KeyframesStepValue::Declarations { block: ref declarations } => { let guard = declarations.read_with(context.guards.author); - // No !important in keyframes. - debug_assert!(!guard.any_important()); - let iter = || { - guard.declarations().iter().rev() + // It's possible to have !important properties in keyframes + // so we have to filter them out. + // See the spec issue https://github.com/w3c/csswg-drafts/issues/1824 + // Also we filter our non-animatable properties. + guard.normal_declaration_iter() + .filter(|declaration| declaration.is_animatable()) .map(|decl| (decl, CascadeLevel::Animations)) };