pub enum Propagate {
None,
UpdatePseudoElements,
InheritedOnly,
RecalcChildren,
RecalcDescendants,
}Expand description
Describes how style changes should propagate to children.
This enum is ordered by “intensity” - higher variants require more work.
The ordering enables max() comparisons when combining changes.
Variants§
None
No children need style updates.
UpdatePseudoElements
Only update pseudo-elements (like scrollbars). Children can keep their existing computed styles.
InheritedOnly
Only inherited properties changed (font-size, color, etc.). Children can use a fast path that skips full selector resolution and only propagates the changed inherited values.
This is a significant optimization: if a parent’s font-size changes,
children using em units need recalc, but we can skip re-matching
selectors like :hover, classes, etc.
RecalcChildren
Recalculate style for immediate children. Typically used when a class was applied that children might match.
RecalcDescendants
Recalculate style for all descendants. Used when a deep structural change occurred (e.g., selector that matches nested elements changed).
Implementations§
Source§impl Propagate
impl Propagate
Sourcepub fn requires_child_traversal(&self) -> bool
pub fn requires_child_traversal(&self) -> bool
Returns true if this propagation requires any child traversal.
Sourcepub fn requires_full_resolution(&self) -> bool
pub fn requires_full_resolution(&self) -> bool
Returns true if this propagation requires full style resolution. When false, the “inherited only” fast path can be used.
Sourcepub fn is_recursive(&self) -> bool
pub fn is_recursive(&self) -> bool
Returns true if all descendants need recalc, not just immediate children.
Trait Implementations§
Source§impl Ord for Propagate
impl Ord for Propagate
Source§impl PartialOrd for Propagate
impl PartialOrd for Propagate
impl Copy for Propagate
impl Eq for Propagate
impl StructuralPartialEq for Propagate
Auto Trait Implementations§
impl Freeze for Propagate
impl RefUnwindSafe for Propagate
impl Send for Propagate
impl Sync for Propagate
impl Unpin for Propagate
impl UnwindSafe for Propagate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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