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<'_>,
longhand_id: LonghandId,
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.