Struct style::animation::ElementAnimationSet
source · pub struct ElementAnimationSet {
pub animations: Vec<Animation>,
pub transitions: Vec<Transition>,
pub dirty: bool,
}
Expand description
Holds the animation state for a particular element.
Fields§
§animations: Vec<Animation>
The animations for this element.
transitions: Vec<Transition>
The transitions for this element.
dirty: bool
Whether or not this ElementAnimationSet has had animations or transitions which have been added, removed, or had their state changed.
Implementations§
source§impl ElementAnimationSet
impl ElementAnimationSet
sourcepub fn cancel_all_animations(&mut self)
pub fn cancel_all_animations(&mut self)
Cancel all animations in this ElementAnimationSet
. This is typically called
when the element has been removed from the DOM.
fn cancel_active_transitions(&mut self)
sourcepub fn apply_active_animations(
&self,
context: &SharedStyleContext<'_>,
style: &mut Arc<ComputedValues>,
)
pub fn apply_active_animations( &self, context: &SharedStyleContext<'_>, style: &mut Arc<ComputedValues>, )
Apply all active animations.
sourcepub fn clear_canceled_animations(&mut self)
pub fn clear_canceled_animations(&mut self)
Clear all canceled animations and transitions from this ElementAnimationSet
.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this ElementAnimationSet
is empty, which means it doesn’t
hold any animations in any state.
sourcepub fn needs_animation_ticks(&self) -> bool
pub fn needs_animation_ticks(&self) -> bool
Whether or not this state needs animation ticks for its transitions or animations.
sourcepub fn running_animation_and_transition_count(&self) -> usize
pub fn running_animation_and_transition_count(&self) -> usize
The number of running animations and transitions for this ElementAnimationSet
.
sourcepub fn has_active_animation(&self) -> bool
pub fn has_active_animation(&self) -> bool
If this ElementAnimationSet
has any any active animations.
sourcepub fn has_active_transition(&self) -> bool
pub fn has_active_transition(&self) -> bool
If this ElementAnimationSet
has any any active transitions.
sourcepub fn update_animations_for_new_style<E>(
&mut self,
element: E,
context: &SharedStyleContext<'_>,
new_style: &Arc<ComputedValues>,
resolver: &mut StyleResolverForElement<'_, '_, '_, E>,
)where
E: TElement,
pub fn update_animations_for_new_style<E>(
&mut self,
element: E,
context: &SharedStyleContext<'_>,
new_style: &Arc<ComputedValues>,
resolver: &mut StyleResolverForElement<'_, '_, '_, E>,
)where
E: TElement,
Update our animations given a new style, canceling or starting new animations when appropriate.
sourcepub fn update_transitions_for_new_style(
&mut self,
might_need_transitions_update: bool,
context: &SharedStyleContext<'_>,
old_style: Option<&Arc<ComputedValues>>,
after_change_style: &Arc<ComputedValues>,
)
pub fn update_transitions_for_new_style( &mut self, might_need_transitions_update: bool, context: &SharedStyleContext<'_>, old_style: Option<&Arc<ComputedValues>>, after_change_style: &Arc<ComputedValues>, )
Update our transitions given a new style, canceling or starting new animations when appropriate.
fn start_transition_if_applicable( &mut self, context: &SharedStyleContext<'_>, property_declaration_id: &PropertyDeclarationId<'_>, index: usize, old_style: &ComputedValues, new_style: &Arc<ComputedValues>, )
sourcepub fn get_value_map_for_active_transitions(
&self,
now: f64,
) -> Option<AnimationValueMap>
pub fn get_value_map_for_active_transitions( &self, now: f64, ) -> Option<AnimationValueMap>
Generate a AnimationValueMap
for this ElementAnimationSet
’s
active transitions at the given time value.
sourcepub fn get_value_map_for_active_animations(
&self,
now: f64,
) -> Option<AnimationValueMap>
pub fn get_value_map_for_active_animations( &self, now: f64, ) -> Option<AnimationValueMap>
Generate a AnimationValueMap
for this ElementAnimationSet
’s
active animations at the given time value.
Trait Implementations§
source§impl Debug for ElementAnimationSet
impl Debug for ElementAnimationSet
source§impl Default for ElementAnimationSet
impl Default for ElementAnimationSet
source§fn default() -> ElementAnimationSet
fn default() -> ElementAnimationSet
source§impl MallocSizeOf for ElementAnimationSet
impl MallocSizeOf for ElementAnimationSet
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for ElementAnimationSet
impl !RefUnwindSafe for ElementAnimationSet
impl Send for ElementAnimationSet
impl Sync for ElementAnimationSet
impl Unpin for ElementAnimationSet
impl !UnwindSafe for ElementAnimationSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more