Split animations and transitions into separate lists

This change splits the list of animations and transitions, which are
almost always handled differently. It also renames
`ElementAnimationState` to `ElementAnimationSet` and establishes an
`AnimationState` for every transition and animation. This allows us to
stop continually reallocating lists every time a transition or animation
needs to be canceled.

Fixes #14419.
This commit is contained in:
Martin Robinson 2020-05-06 14:57:23 +02:00
parent b290ad95c1
commit b8874ad6ac
5 changed files with 670 additions and 692 deletions

View file

@ -5,7 +5,7 @@
//! The context within which style is calculated.
#[cfg(feature = "servo")]
use crate::animation::ElementAnimationState;
use crate::animation::ElementAnimationSet;
use crate::bloom::StyleBloom;
use crate::data::{EagerPseudoStyles, ElementData};
#[cfg(feature = "servo")]
@ -167,7 +167,7 @@ pub struct SharedStyleContext<'a> {
/// The state of all animations for our styled elements.
#[cfg(feature = "servo")]
pub animation_states: Arc<RwLock<FxHashMap<OpaqueNode, ElementAnimationState>>>,
pub animation_states: Arc<RwLock<FxHashMap<OpaqueNode, ElementAnimationSet>>>,
/// Paint worklets
#[cfg(feature = "servo")]