Struct style::rule_tree::level::ShadowCascadeOrder
source · pub struct ShadowCascadeOrder(i8);
Expand description
A counter to track how many shadow root rules deep we are. This is used to handle:
https://drafts.csswg.org/css-scoping/#shadow-cascading
See the static functions for the meaning of different values.
Tuple Fields§
§0: i8
Implementations§
source§impl ShadowCascadeOrder
impl ShadowCascadeOrder
sourceconst MAX: i8 = 7i8
const MAX: i8 = 7i8
We keep a maximum of 3 bits of order as a limit so that we can pack CascadeLevel in one byte by using half of it for the order, if that ends up being necessary.
const MIN: i8 = -7i8
sourcepub fn for_outermost_shadow_tree() -> Self
pub fn for_outermost_shadow_tree() -> Self
A level for the outermost shadow tree (the shadow tree we own, and the ones from the slots we’re slotted in).
sourcefn for_same_tree() -> Self
fn for_same_tree() -> Self
A level for the element’s tree.
sourcepub fn for_innermost_containing_tree() -> Self
pub fn for_innermost_containing_tree() -> Self
A level for the innermost containing tree (the one closest to the element).
Trait Implementations§
source§impl Clone for ShadowCascadeOrder
impl Clone for ShadowCascadeOrder
source§fn clone(&self) -> ShadowCascadeOrder
fn clone(&self) -> ShadowCascadeOrder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ShadowCascadeOrder
impl Debug for ShadowCascadeOrder
source§impl Hash for ShadowCascadeOrder
impl Hash for ShadowCascadeOrder
source§impl MallocSizeOf for ShadowCascadeOrder
impl MallocSizeOf for ShadowCascadeOrder
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl Neg for ShadowCascadeOrder
impl Neg for ShadowCascadeOrder
source§impl Ord for ShadowCascadeOrder
impl Ord for ShadowCascadeOrder
source§fn cmp(&self, other: &ShadowCascadeOrder) -> Ordering
fn cmp(&self, other: &ShadowCascadeOrder) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ShadowCascadeOrder
impl PartialEq for ShadowCascadeOrder
source§fn eq(&self, other: &ShadowCascadeOrder) -> bool
fn eq(&self, other: &ShadowCascadeOrder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ShadowCascadeOrder
impl PartialOrd for ShadowCascadeOrder
source§fn partial_cmp(&self, other: &ShadowCascadeOrder) -> Option<Ordering>
fn partial_cmp(&self, other: &ShadowCascadeOrder) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ShadowCascadeOrder
impl Eq for ShadowCascadeOrder
impl StructuralPartialEq for ShadowCascadeOrder
Auto Trait Implementations§
impl Freeze for ShadowCascadeOrder
impl RefUnwindSafe for ShadowCascadeOrder
impl Send for ShadowCascadeOrder
impl Sync for ShadowCascadeOrder
impl Unpin for ShadowCascadeOrder
impl UnwindSafe for ShadowCascadeOrder
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
Mutably borrows from an owned value. Read more
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§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
Compare self to
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>
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 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>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert