pub enum PseudoElementCascadeType {
Eager,
Lazy,
Precomputed,
}
Expand description
This enumeration determines how a pseudo-element cascades.
Variants§
Eager
Eagerly cascaded pseudo-elements are “normal” pseudo-elements (i.e.
::before
and ::after
). They inherit styles normally as another
selector would do, and they’re computed as part of the cascade.
These kind of pseudo-elements require more up-front computation and
storage and thus should used for public pseudo-elements that can be used
on many element types (such as ::before
and ::after
).
Lazy
Lazy pseudo-elements are affected by selector matching, but they’re only
computed when needed, and not before. They’re useful for general
pseudo-elements that are not very common or that do not apply to many
elements. For instance in Servo this is used for ::backdrop
and
::marker
.
Precomputed
Precomputed pseudo-elements skip the cascade process entirely, mostly as
an optimisation since they are private pseudo-elements (like
::-servo-details-content
).
This pseudo-elements are resolved on the fly using only global rules
(rules of the form *|*
), and applying them to the parent style so are
mainly useful for user-agent stylesheets.
Trait Implementations§
Source§impl Clone for PseudoElementCascadeType
impl Clone for PseudoElementCascadeType
Source§fn clone(&self) -> PseudoElementCascadeType
fn clone(&self) -> PseudoElementCascadeType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PseudoElementCascadeType
impl Debug for PseudoElementCascadeType
Source§impl PartialEq for PseudoElementCascadeType
impl PartialEq for PseudoElementCascadeType
impl Eq for PseudoElementCascadeType
impl StructuralPartialEq for PseudoElementCascadeType
Auto Trait Implementations§
impl Freeze for PseudoElementCascadeType
impl RefUnwindSafe for PseudoElementCascadeType
impl Send for PseudoElementCascadeType
impl Sync for PseudoElementCascadeType
impl Unpin for PseudoElementCascadeType
impl UnwindSafe for PseudoElementCascadeType
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> Equivalent<K> for Q
impl<Q, K> Equivalent<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<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