Add DocumentAnimationSet and AnimationSetKey

This will be used in order to hold animations for pseudo elements in the
DocumentAnimationSet. Also no longer store the OpaqueNode in the
animation and transition data structures. This is already part of the
DocumentAnimationSet key.
This commit is contained in:
Martin Robinson 2020-06-15 09:21:35 +02:00
parent 6b0d9afd6f
commit 4a3995bb37
11 changed files with 184 additions and 162 deletions

View file

@ -5,11 +5,9 @@
//! The context within which style is calculated.
#[cfg(feature = "servo")]
use crate::animation::ElementAnimationSet;
use crate::animation::DocumentAnimationSet;
use crate::bloom::StyleBloom;
use crate::data::{EagerPseudoStyles, ElementData};
#[cfg(feature = "servo")]
use crate::dom::OpaqueNode;
use crate::dom::{SendElement, TElement};
use crate::font_metrics::FontMetricsProvider;
#[cfg(feature = "gecko")]
@ -31,10 +29,9 @@ use app_units::Au;
use euclid::default::Size2D;
use euclid::Scale;
use fxhash::FxHashMap;
#[cfg(feature = "servo")]
use parking_lot::RwLock;
use selectors::matching::ElementSelectorFlags;
use selectors::NthIndexCache;
#[cfg(feature = "gecko")]
use servo_arc::Arc;
#[cfg(feature = "servo")]
use servo_atoms::Atom;
@ -167,7 +164,7 @@ pub struct SharedStyleContext<'a> {
/// The state of all animations for our styled elements.
#[cfg(feature = "servo")]
pub animation_states: Arc<RwLock<FxHashMap<OpaqueNode, ElementAnimationSet>>>,
pub animations: DocumentAnimationSet,
/// Paint worklets
#[cfg(feature = "servo")]