Struct style::invalidation::element::restyle_hints::RestyleHint
source · #[repr(C)]pub struct RestyleHint(<RestyleHint as PublicFlags>::Internal);
Expand description
The kind of restyle we need to do for a given element.
Tuple Fields§
§0: <RestyleHint as PublicFlags>::Internal
Implementations§
source§impl RestyleHint
impl RestyleHint
sourcepub const RESTYLE_SELF: Self = _
pub const RESTYLE_SELF: Self = _
Do a selector match of the element.
sourcepub const RESTYLE_PSEUDOS: Self = _
pub const RESTYLE_PSEUDOS: Self = _
Do a selector match of the element’s pseudo-elements. Always to be combined with RESTYLE_SELF.
sourcepub const RESTYLE_SELF_IF_PSEUDO: Self = _
pub const RESTYLE_SELF_IF_PSEUDO: Self = _
Do a selector match if the element is a pseudo-element.
sourcepub const RESTYLE_DESCENDANTS: Self = _
pub const RESTYLE_DESCENDANTS: Self = _
Do a selector match of the element’s descendants.
sourcepub const RECASCADE_SELF: Self = _
pub const RECASCADE_SELF: Self = _
Recascade the current element.
sourcepub const RECASCADE_SELF_IF_INHERIT_RESET_STYLE: Self = _
pub const RECASCADE_SELF_IF_INHERIT_RESET_STYLE: Self = _
Recascade the current element if it inherits any reset style.
sourcepub const RECASCADE_DESCENDANTS: Self = _
pub const RECASCADE_DESCENDANTS: Self = _
Recascade all descendant elements.
sourcepub const RESTYLE_CSS_TRANSITIONS: Self = _
pub const RESTYLE_CSS_TRANSITIONS: Self = _
Replace the style data coming from CSS transitions without updating any other style data. This hint is only processed in animation-only traversal which is prior to normal traversal.
sourcepub const RESTYLE_CSS_ANIMATIONS: Self = _
pub const RESTYLE_CSS_ANIMATIONS: Self = _
Replace the style data coming from CSS animations without updating any other style data. This hint is only processed in animation-only traversal which is prior to normal traversal.
sourcepub const RESTYLE_STYLE_ATTRIBUTE: Self = _
pub const RESTYLE_STYLE_ATTRIBUTE: Self = _
Don’t re-run selector-matching on the element, only the style attribute has changed, and this change didn’t have any other dependencies.
sourcepub const RESTYLE_SMIL: Self = _
pub const RESTYLE_SMIL: Self = _
Replace the style data coming from SMIL animations without updating any other style data. This hint is only processed in animation-only traversal which is prior to normal traversal.
source§impl RestyleHint
impl RestyleHint
sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u16) -> Option<Self>
pub const fn from_bits(bits: u16) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u16) -> Self
pub const fn from_bits_truncate(bits: u16) -> Self
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u16) -> Self
pub const fn from_bits_retain(bits: u16) -> Self
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
source§impl RestyleHint
impl RestyleHint
sourcepub const fn iter(&self) -> Iter<RestyleHint>
pub const fn iter(&self) -> Iter<RestyleHint>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
sourcepub const fn iter_names(&self) -> IterNames<RestyleHint>
pub const fn iter_names(&self) -> IterNames<RestyleHint>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
source§impl RestyleHint
impl RestyleHint
sourcepub fn restyle_subtree() -> Self
pub fn restyle_subtree() -> Self
Creates a new RestyleHint
indicating that the current element and all
its descendants must be fully restyled.
sourcepub fn recascade_subtree() -> Self
pub fn recascade_subtree() -> Self
Creates a new RestyleHint
indicating that the current element and all
its descendants must be recascaded.
sourcepub fn contains_subtree(&self) -> bool
pub fn contains_subtree(&self) -> bool
Returns whether this hint invalidates the element and all its descendants.
sourcepub fn will_recascade_subtree(&self) -> bool
pub fn will_recascade_subtree(&self) -> bool
Returns whether we’ll recascade all of the descendants.
sourcepub fn has_non_animation_invalidations(&self) -> bool
pub fn has_non_animation_invalidations(&self) -> bool
Returns whether we need to restyle this element.
sourcepub fn propagate(&mut self, traversal_flags: &TraversalFlags) -> Self
pub fn propagate(&mut self, traversal_flags: &TraversalFlags) -> Self
Propagates this restyle hint to a child element.
sourcefn propagate_for_non_animation_restyle(&self) -> Self
fn propagate_for_non_animation_restyle(&self) -> Self
Returns a new RestyleHint
appropriate for children of the current element.
sourcepub fn replacements() -> Self
pub fn replacements() -> Self
Returns a hint that contains all the replacement hints.
sourcepub fn for_animations() -> Self
pub fn for_animations() -> Self
The replacements for the animation cascade levels.
sourcepub fn has_animation_hint(&self) -> bool
pub fn has_animation_hint(&self) -> bool
Returns whether the hint specifies that an animation cascade level must be replaced.
sourcepub fn has_animation_hint_or_recascade(&self) -> bool
pub fn has_animation_hint_or_recascade(&self) -> bool
Returns whether the hint specifies that an animation cascade level must be replaced.
sourcepub fn has_non_animation_hint(&self) -> bool
pub fn has_non_animation_hint(&self) -> bool
Returns whether the hint specifies some restyle work other than an animation cascade level replacement.
sourcepub fn has_replacements(&self) -> bool
pub fn has_replacements(&self) -> bool
Returns whether the hint specifies that some cascade levels must be replaced.
sourcepub fn remove_animation_hints(&mut self)
pub fn remove_animation_hints(&mut self)
Removes all of the animation-related hints.
Trait Implementations§
source§impl Binary for RestyleHint
impl Binary for RestyleHint
source§impl BitAnd for RestyleHint
impl BitAnd for RestyleHint
source§impl BitAndAssign for RestyleHint
impl BitAndAssign for RestyleHint
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
source§impl BitOr for RestyleHint
impl BitOr for RestyleHint
source§fn bitor(self, other: RestyleHint) -> Self
fn bitor(self, other: RestyleHint) -> Self
The bitwise or (|
) of the bits in two flags values.
§type Output = RestyleHint
type Output = RestyleHint
|
operator.source§impl BitOrAssign for RestyleHint
impl BitOrAssign for RestyleHint
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
source§impl BitXor for RestyleHint
impl BitXor for RestyleHint
source§impl BitXorAssign for RestyleHint
impl BitXorAssign for RestyleHint
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
source§impl Clone for RestyleHint
impl Clone for RestyleHint
source§fn clone(&self) -> RestyleHint
fn clone(&self) -> RestyleHint
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RestyleHint
impl Debug for RestyleHint
source§impl Default for RestyleHint
impl Default for RestyleHint
source§impl Extend<RestyleHint> for RestyleHint
impl Extend<RestyleHint> for RestyleHint
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl Flags for RestyleHint
impl Flags for RestyleHint
source§const FLAGS: &'static [Flag<RestyleHint>] = _
const FLAGS: &'static [Flag<RestyleHint>] = _
source§fn from_bits_retain(bits: u16) -> RestyleHint
fn from_bits_retain(bits: u16) -> RestyleHint
source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moresource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moresource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.source§impl FromIterator<RestyleHint> for RestyleHint
impl FromIterator<RestyleHint> for RestyleHint
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
source§impl IntoIterator for RestyleHint
impl IntoIterator for RestyleHint
source§impl LowerHex for RestyleHint
impl LowerHex for RestyleHint
source§impl MallocSizeOf for RestyleHint
impl MallocSizeOf for RestyleHint
source§fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
source§impl Not for RestyleHint
impl Not for RestyleHint
source§impl Octal for RestyleHint
impl Octal for RestyleHint
source§impl PublicFlags for RestyleHint
impl PublicFlags for RestyleHint
source§impl Sub for RestyleHint
impl Sub for RestyleHint
source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = RestyleHint
type Output = RestyleHint
-
operator.source§impl SubAssign for RestyleHint
impl SubAssign for RestyleHint
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
source§impl UpperHex for RestyleHint
impl UpperHex for RestyleHint
impl Copy for RestyleHint
Auto Trait Implementations§
impl Freeze for RestyleHint
impl RefUnwindSafe for RestyleHint
impl Send for RestyleHint
impl Sync for RestyleHint
impl Unpin for RestyleHint
impl UnwindSafe for RestyleHint
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