mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Cleanup some of the animation starting code.
This commit is contained in:
parent
5327758b9b
commit
d44bd82703
1 changed files with 59 additions and 56 deletions
|
@ -544,10 +544,9 @@ where
|
|||
|
||||
let box_style = new_style.get_box();
|
||||
for (i, name) in box_style.animation_name_iter().enumerate() {
|
||||
let name = if let Some(atom) = name.as_atom() {
|
||||
atom
|
||||
} else {
|
||||
continue;
|
||||
let name = match name.as_atom() {
|
||||
Some(atom) => atom,
|
||||
None => continue,
|
||||
};
|
||||
|
||||
debug!("maybe_start_animations: name={}", name);
|
||||
|
@ -556,7 +555,11 @@ where
|
|||
continue;
|
||||
}
|
||||
|
||||
if let Some(anim) = context.stylist.get_animation(name, element) {
|
||||
let anim = match context.stylist.get_animation(name, element) {
|
||||
Some(animation) => animation,
|
||||
None => continue,
|
||||
};
|
||||
|
||||
debug!("maybe_start_animations: animation {} found", name);
|
||||
|
||||
// If this animation doesn't have any keyframe, we can just continue
|
||||
|
@ -601,17 +604,17 @@ where
|
|||
started_at: animation_start,
|
||||
duration: duration as f64,
|
||||
delay: delay as f64,
|
||||
iteration_state: iteration_state,
|
||||
running_state: running_state,
|
||||
iteration_state,
|
||||
running_state,
|
||||
direction: animation_direction,
|
||||
current_direction: initial_direction,
|
||||
expired: false,
|
||||
cascade_style: new_style.clone(),
|
||||
},
|
||||
)).unwrap();
|
||||
))
|
||||
.unwrap();
|
||||
had_animations = true;
|
||||
}
|
||||
}
|
||||
|
||||
had_animations
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue