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

source

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.

source

fn cancel_active_transitions(&mut self)

source

pub fn apply_active_animations(
    &self,
    context: &SharedStyleContext<'_>,
    style: &mut Arc<ComputedValues>
)

Apply all active animations.

source

pub fn clear_canceled_animations(&mut self)

Clear all canceled animations and transitions from this ElementAnimationSet.

source

pub fn is_empty(&self) -> bool

Whether this ElementAnimationSet is empty, which means it doesn’t hold any animations in any state.

source

pub fn needs_animation_ticks(&self) -> bool

Whether or not this state needs animation ticks for its transitions or animations.

source

pub fn running_animation_and_transition_count(&self) -> usize

The number of running animations and transitions for this ElementAnimationSet.

source

pub fn has_active_animation(&self) -> bool

If this ElementAnimationSet has any any active animations.

source

pub fn has_active_transition(&self) -> bool

If this ElementAnimationSet has any any active transitions.

source

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.

source

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.

source

fn start_transition_if_applicable(
    &mut self,
    context: &SharedStyleContext<'_>,
    longhand_id: LonghandId,
    index: usize,
    old_style: &ComputedValues,
    new_style: &Arc<ComputedValues>
)

source

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.

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ElementAnimationSet

source§

fn default() -> ElementAnimationSet

Returns the “default value” for a type. Read more
source§

impl MallocSizeOf for ElementAnimationSet

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> MaybeBoxed<Box<T, Global>> for T

source§

fn maybe_boxed(self) -> Box<T, Global>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere
    V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
    S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Erased for T