Struct style::invalidation::element::invalidator::TreeStyleInvalidator
source · 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,
impl<'a, 'b, 'c, E, P> TreeStyleInvalidator<'a, 'b, 'c, E, P>where
E: TElement,
P: InvalidationProcessor<'b, 'c, E> + 'a,
'b: 'a,
sourcepub fn new(
element: E,
stack_limit_checker: Option<&'a StackLimitChecker>,
processor: &'a mut P,
) -> Self
pub fn new( element: E, stack_limit_checker: Option<&'a StackLimitChecker>, processor: &'a mut P, ) -> Self
Trivially constructs a new TreeStyleInvalidator
.
sourcepub fn invalidate(self) -> InvalidationResult
pub fn invalidate(self) -> InvalidationResult
Perform the invalidation pass.
sourcefn invalidate_siblings(
&mut self,
sibling_invalidations: &mut InvalidationVector<'b>,
) -> bool
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.
fn invalidate_pseudo_element_or_nac( &mut self, child: E, invalidations: &[Invalidation<'b>], ) -> bool
sourcefn invalidate_child(
&mut self,
child: E,
invalidations: &[Invalidation<'b>],
sibling_invalidations: &mut InvalidationVector<'b>,
descendant_invalidation_kind: DescendantInvalidationKind,
) -> bool
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.
fn invalidate_nac(&mut self, invalidations: &[Invalidation<'b>]) -> bool
fn invalidate_dom_descendants_of( &mut self, parent: E::ConcreteNode, invalidations: &[Invalidation<'b>], ) -> bool
fn invalidate_parts_in_shadow_tree( &mut self, shadow: <E::ConcreteNode as TNode>::ConcreteShadowRoot, invalidations: &[Invalidation<'b>], ) -> bool
fn invalidate_parts(&mut self, invalidations: &[Invalidation<'b>]) -> bool
fn invalidate_slotted_elements( &mut self, invalidations: &[Invalidation<'b>], ) -> bool
fn invalidate_slotted_elements_in_slot( &mut self, slot: E, invalidations: &[Invalidation<'b>], ) -> bool
fn invalidate_non_slotted_descendants( &mut self, invalidations: &[Invalidation<'b>], ) -> bool
sourcefn invalidate_descendants(
&mut self,
invalidations: &DescendantInvalidationLists<'b>,
) -> bool
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.
sourcefn process_sibling_invalidations(
&mut self,
descendant_invalidations: &mut DescendantInvalidationLists<'b>,
sibling_invalidations: &mut InvalidationVector<'b>,
) -> bool
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.
sourcefn process_descendant_invalidations(
&mut self,
invalidations: &[Invalidation<'b>],
descendant_invalidations: &mut DescendantInvalidationLists<'b>,
sibling_invalidations: &mut InvalidationVector<'b>,
descendant_invalidation_kind: DescendantInvalidationKind,
) -> bool
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.
sourcefn process_invalidation(
&mut self,
invalidation: &Invalidation<'b>,
descendant_invalidations: &mut DescendantInvalidationLists<'b>,
sibling_invalidations: &mut InvalidationVector<'b>,
invalidation_kind: InvalidationKind,
) -> SingleInvalidationResult
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>where
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<'a, 'b, 'c, E, P> Send for TreeStyleInvalidator<'a, 'b, 'c, E, P>
impl<'a, 'b, 'c, E, P> Sync for TreeStyleInvalidator<'a, 'b, 'c, E, P>
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> 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