mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Have Animations struct handle rooting nodes
Instead of having `ScriptThread` handle rooting nodes, do this in `Animations`. This makes it easier to know when it is appropriate to root and unroot nodes instead of relying on a certain order of events. This also allows reducing quite a bit the amount of unsafe code.
This commit is contained in:
parent
7170a69695
commit
47642e0eee
5 changed files with 278 additions and 339 deletions
|
@ -346,15 +346,6 @@ impl Animation {
|
|||
self.started_at = new_started_at;
|
||||
}
|
||||
|
||||
/// Calculate the active-duration of this animation according to
|
||||
/// https://drafts.csswg.org/css-animations/#active-duration.
|
||||
pub fn active_duration(&self) -> f64 {
|
||||
match self.iteration_state {
|
||||
KeyframesIterationState::Finite(current, _) |
|
||||
KeyframesIterationState::Infinite(current) => self.duration * current,
|
||||
}
|
||||
}
|
||||
|
||||
/// Update the given style to reflect the values specified by this `Animation`
|
||||
/// at the time provided by the given `SharedStyleContext`.
|
||||
fn update_style<E>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue