mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Allow empty keyframe and keyframes with non-animatable properties.
We need to create CSS animations that have empty keyframe or keyframes which have only invalid properties or non-animatable properties to fire animation events for such animations.
This commit is contained in:
parent
8421ae6077
commit
a80725c91b
4 changed files with 67 additions and 31 deletions
|
@ -182,6 +182,7 @@ impl Stylist {
|
|||
self.precomputed_pseudo_element_decls = Default::default();
|
||||
self.rules_source_order = 0;
|
||||
self.state_deps.clear();
|
||||
self.animations.clear();
|
||||
|
||||
self.sibling_affecting_selectors.clear();
|
||||
self.non_common_style_affecting_attributes_selectors.clear();
|
||||
|
@ -274,16 +275,9 @@ impl Stylist {
|
|||
CssRule::Keyframes(ref keyframes_rule) => {
|
||||
let keyframes_rule = keyframes_rule.read();
|
||||
debug!("Found valid keyframes rule: {:?}", *keyframes_rule);
|
||||
if let Some(animation) = KeyframesAnimation::from_keyframes(&keyframes_rule.keyframes) {
|
||||
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);
|
||||
}
|
||||
let animation = KeyframesAnimation::from_keyframes(&keyframes_rule.keyframes);
|
||||
debug!("Found valid keyframe animation: {:?}", animation);
|
||||
self.animations.insert(keyframes_rule.name.clone(), animation);
|
||||
}
|
||||
// We don't care about any other rule.
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue