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:
Martin Robinson 2020-05-23 14:22:43 +02:00
parent 7170a69695
commit 47642e0eee
5 changed files with 278 additions and 339 deletions

View file

@ -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>(