pub struct TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: TElement, P: InvalidationProcessor<'b, 'c, E> + 'a, 'b: 'a,
{ element: E, stack_limit_checker: Option<&'a StackLimitChecker>, processor: &'a mut P, _marker: PhantomData<(&'b (), &'c ())>, }
Expand description

The struct that takes care of encapsulating all the logic on where and how element styles need to be invalidated.

Fields§

§element: E§stack_limit_checker: Option<&'a StackLimitChecker>§processor: &'a mut P§_marker: PhantomData<(&'b (), &'c ())>

Implementations§

source§

impl<'a, 'b, 'c, E, P> TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: TElement, P: InvalidationProcessor<'b, 'c, E> + 'a, 'b: 'a,

source

pub fn new( element: E, stack_limit_checker: Option<&'a StackLimitChecker>, processor: &'a mut P, ) -> Self

Trivially constructs a new TreeStyleInvalidator.

source

pub fn invalidate(self) -> InvalidationResult

Perform the invalidation pass.

source

fn invalidate_siblings( &mut self, sibling_invalidations: &mut InvalidationVector<'b>, ) -> bool

Go through later DOM siblings, invalidating style as needed using the sibling_invalidations list.

Returns whether any sibling’s style or any sibling descendant’s style was invalidated.

source

fn invalidate_pseudo_element_or_nac( &mut self, child: E, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_child( &mut self, child: E, invalidations: &[Invalidation<'b>], sibling_invalidations: &mut InvalidationVector<'b>, descendant_invalidation_kind: DescendantInvalidationKind, ) -> bool

Invalidate a child and recurse down invalidating its descendants if needed.

source

fn invalidate_nac(&mut self, invalidations: &[Invalidation<'b>]) -> bool

source

fn invalidate_dom_descendants_of( &mut self, parent: E::ConcreteNode, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_parts_in_shadow_tree( &mut self, shadow: <E::ConcreteNode as TNode>::ConcreteShadowRoot, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_parts(&mut self, invalidations: &[Invalidation<'b>]) -> bool

source

fn invalidate_slotted_elements( &mut self, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_slotted_elements_in_slot( &mut self, slot: E, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_non_slotted_descendants( &mut self, invalidations: &[Invalidation<'b>], ) -> bool

source

fn invalidate_descendants( &mut self, invalidations: &DescendantInvalidationLists<'b>, ) -> bool

Given the descendant invalidation lists, go through the current element’s descendants, and invalidate style on them.

source

fn process_sibling_invalidations( &mut self, descendant_invalidations: &mut DescendantInvalidationLists<'b>, sibling_invalidations: &mut InvalidationVector<'b>, ) -> bool

Process the given sibling invalidations coming from our previous sibling.

The sibling invalidations are somewhat special because they can be modified on the fly. New invalidations may be added and removed.

In particular, all descendants get the same set of invalidations from the parent, but the invalidations from a given sibling depend on the ones we got from the previous one.

Returns whether invalidated the current element’s style.

source

fn process_descendant_invalidations( &mut self, invalidations: &[Invalidation<'b>], descendant_invalidations: &mut DescendantInvalidationLists<'b>, sibling_invalidations: &mut InvalidationVector<'b>, descendant_invalidation_kind: DescendantInvalidationKind, ) -> bool

Process a given invalidation list coming from our parent, adding to descendant_invalidations and sibling_invalidations as needed.

Returns whether our style was invalidated as a result.

source

fn process_invalidation( &mut self, invalidation: &Invalidation<'b>, descendant_invalidations: &mut DescendantInvalidationLists<'b>, sibling_invalidations: &mut InvalidationVector<'b>, invalidation_kind: InvalidationKind, ) -> SingleInvalidationResult

Processes a given invalidation, potentially invalidating the style of the current element.

Returns whether invalidated the style of the element, and whether the invalidation should be effective to subsequent siblings or descendants down in the tree.

Auto Trait Implementations§

§

impl<'a, 'b, 'c, E, P> Freeze for TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: Freeze,

§

impl<'a, 'b, 'c, E, P> RefUnwindSafe for TreeStyleInvalidator<'a, 'b, 'c, E, P>

§

impl<'a, 'b, 'c, E, P> Send for TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: Send, P: Send,

§

impl<'a, 'b, 'c, E, P> Sync for TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: Sync, P: Sync,

§

impl<'a, 'b, 'c, E, P> Unpin for TreeStyleInvalidator<'a, 'b, 'c, E, P>
where E: Unpin,

§

impl<'a, 'b, 'c, E, P> !UnwindSafe for TreeStyleInvalidator<'a, 'b, 'c, E, P>

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<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