mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Remove an unsound where clause, and don't reset the iteration count on restyle.
This commit is contained in:
parent
173f489d7b
commit
793de6dff2
1 changed files with 11 additions and 2 deletions
|
@ -123,8 +123,7 @@ impl<Impl: SelectorImplExt> KeyframesAnimationState<Impl> {
|
|||
///
|
||||
/// There are some bits of state we can't just replace, over all taking in
|
||||
/// account times, so here's that logic.
|
||||
pub fn update_from_other(&mut self, other: &Self)
|
||||
where Self: Clone {
|
||||
pub fn update_from_other(&mut self, other: &Self) {
|
||||
use self::KeyframesRunningState::*;
|
||||
|
||||
debug!("KeyframesAnimationState::update_from_other({:?}, {:?})", self, other);
|
||||
|
@ -135,6 +134,7 @@ impl<Impl: SelectorImplExt> KeyframesAnimationState<Impl> {
|
|||
let old_duration = self.duration;
|
||||
let old_direction = self.current_direction;
|
||||
let old_running_state = self.running_state.clone();
|
||||
let old_iteration_state = self.iteration_state.clone();
|
||||
*self = other.clone();
|
||||
|
||||
let mut new_started_at = old_started_at;
|
||||
|
@ -155,6 +155,15 @@ impl<Impl: SelectorImplExt> KeyframesAnimationState<Impl> {
|
|||
_ => {},
|
||||
}
|
||||
|
||||
// Don't update the iteration count, just the iteration limit.
|
||||
// TODO: see how changing the limit affects rendering in other browsers.
|
||||
// We might need to keep the iteration count even when it's infinite.
|
||||
match (&mut self.iteration_state, old_iteration_state) {
|
||||
(&mut KeyframesIterationState::Finite(ref mut iters, _), KeyframesIterationState::Finite(old_iters, _))
|
||||
=> *iters = old_iters,
|
||||
_ => {}
|
||||
}
|
||||
|
||||
self.current_direction = old_direction;
|
||||
self.started_at = new_started_at;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue