ElementDataRef

Struct ElementDataRef 

Source
pub struct ElementDataRef<'a> {
    v: &'a ElementData,
    _borrow: AtomicRef<'a, ()>,
}
Expand description

A mutable reference to ElementData.

Fields§

§v: &'a ElementData§_borrow: AtomicRef<'a, ()>

Methods from Deref<Target = ElementData>§

Source

pub fn has_styles(&self) -> bool

Returns true if this element has styles.

Source

pub fn share_styles(&self) -> ResolvedElementStyles

Returns this element’s styles as resolved styles to use for sharing.

Source

pub fn share_primary_style(&self) -> PrimaryStyle

Returns this element’s primary style as a resolved style to use for sharing.

Source

pub fn restyle_kind( &self, shared_context: &SharedStyleContext<'_>, ) -> Option<RestyleKind>

Returns the kind of restyling that we’re going to need to do on this element, based of the stored restyle hint.

Source

fn restyle_kind_for_animation( &self, shared_context: &SharedStyleContext<'_>, ) -> Option<RestyleKind>

Returns the kind of restyling for animation-only restyle.

Source

pub fn is_restyle(&self) -> bool

Returns true if this element was restyled.

Source

pub fn contains_restyle_data(&self) -> bool

Returns whether this element has been part of a restyle.

Source

pub fn safe_for_cousin_sharing(&self) -> bool

Returns whether it is safe to perform cousin sharing based on the ComputedValues identity of the primary style in this ElementData. There are a few subtle things to check.

First, if a parent element was already styled and we traversed past it without restyling it, that may be because our clever invalidation logic was able to prove that the styles of that element would remain unchanged despite changes to the id or class attributes. However, style sharing relies on the strong guarantee that all the classes and ids up the respective parent chains are identical. As such, if we skipped styling for one (or both) of the parents on this traversal, we can’t share styles across cousins. Note that this is a somewhat conservative check. We could tighten it by having the invalidation logic explicitly flag elements for which it ellided styling.

Second, we want to only consider elements whose ComputedValues match due to a hit in the style sharing cache, rather than due to the rule-node-based reuse that happens later in the styling pipeline. The former gives us the stronger guarantees we need for style sharing, the latter does not.

Source

pub fn may_have_starting_style(&self) -> bool

Returns true if this element data may need to compute the starting style for CSS transitions.

Trait Implementations§

Source§

impl<'a> Debug for ElementDataRef<'a>

Source§

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

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

impl<'a> Deref for ElementDataRef<'a>

Source§

type Target = ElementData

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for ElementDataRef<'a>

§

impl<'a> !RefUnwindSafe for ElementDataRef<'a>

§

impl<'a> Send for ElementDataRef<'a>

§

impl<'a> Sync for ElementDataRef<'a>

§

impl<'a> Unpin for ElementDataRef<'a>

§

impl<'a> !UnwindSafe for ElementDataRef<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

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

The alignment of pointer.
Source§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T