#[repr(C, u8)]pub enum CascadeLevel {
UANormal,
UserNormal,
PresHints,
AuthorNormal {
shadow_cascade_order: ShadowCascadeOrder,
},
PositionFallback,
SMILOverride,
Animations,
AuthorImportant {
shadow_cascade_order: ShadowCascadeOrder,
},
UserImportant,
UAImportant,
Transitions,
}Expand description
The cascade level these rules are relevant at, as per13.
Presentational hints for SVG and HTML are in the “author-level zero-specificity” level, that is, right after user rules, and before author rules.
The order of variants declared here is significant, and must be in ascending order of precedence.
See also 4 for the Shadow DOM bits. We rely on the invariant that rules from outside the tree the element is in can’t affect the element.
The opposite is not true (i.e., :host and ::slotted) from an “inner” shadow tree may affect an element connected to the document or an “outer” shadow tree.
Variants§
UANormal
Normal User-Agent rules.
UserNormal
User normal rules.
PresHints
Presentational hints.
AuthorNormal
Shadow DOM styles from author styles.
Fields
shadow_cascade_order: ShadowCascadeOrderThe order in the shadow tree hierarchy. This number is relative to the tree of the element, and thus the only invariants that need to be preserved is:
-
Zero is the same tree as the element that matched the rule. This is important so that we can optimize style attribute insertions.
-
The levels are ordered in accordance with https://drafts.csswg.org/css-scoping/#shadow-cascading
PositionFallback
https://drafts.csswg.org/css-anchor-position-1/#position-fallback-origin
SMILOverride
SVG SMIL animations.
Animations
CSS animations and script-generated animations.
AuthorImportant
Author-supplied important rules.
Fields
shadow_cascade_order: ShadowCascadeOrderThe order in the shadow tree hierarchy, inverted, so that PartialOrd does the right thing.
UserImportant
User important rules.
UAImportant
User-agent important rules.
Transitions
Transitions
Implementations§
Source§impl CascadeLevel
impl CascadeLevel
Sourcepub fn unimportant(&self) -> Self
pub fn unimportant(&self) -> Self
Convert this level from “important” to “non-important”.
Sourcepub fn guard<'a>(
&self,
guards: &'a StylesheetGuards<'a>,
) -> &'a SharedRwLockReadGuard<'a>
pub fn guard<'a>( &self, guards: &'a StylesheetGuards<'a>, ) -> &'a SharedRwLockReadGuard<'a>
Select a lock guard for this level
Returns the cascade level for author important declarations from the same tree as the element.
Returns the cascade level for author normal declarations from the same tree as the element.
Sourcepub fn is_important(&self) -> bool
pub fn is_important(&self) -> bool
Returns whether this cascade level represents important rules of some sort.
Sourcepub fn importance(&self) -> Importance
pub fn importance(&self) -> Importance
Returns the importance relevant for this rule. Pretty similar to
is_important.
Sourcepub fn is_animation(&self) -> bool
pub fn is_animation(&self) -> bool
Returns whether this cascade level represents an animation rules.
Trait Implementations§
Source§impl Clone for CascadeLevel
impl Clone for CascadeLevel
Source§fn clone(&self) -> CascadeLevel
fn clone(&self) -> CascadeLevel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CascadeLevel
impl Debug for CascadeLevel
Source§impl<'de> Deserialize<'de> for CascadeLevel
impl<'de> Deserialize<'de> for CascadeLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for CascadeLevel
impl Hash for CascadeLevel
Source§impl MallocSizeOf for CascadeLevel
impl MallocSizeOf for CascadeLevel
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl Ord for CascadeLevel
impl Ord for CascadeLevel
Source§fn cmp(&self, other: &CascadeLevel) -> Ordering
fn cmp(&self, other: &CascadeLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CascadeLevel
impl PartialEq for CascadeLevel
Source§impl PartialOrd for CascadeLevel
impl PartialOrd for CascadeLevel
Source§impl Serialize for CascadeLevel
impl Serialize for CascadeLevel
Source§impl SpecifiedValueInfo for CascadeLevel
impl SpecifiedValueInfo for CascadeLevel
Source§const SUPPORTED_TYPES: u8
const SUPPORTED_TYPES: u8
Source§impl ToAnimatedValue for CascadeLevel
impl ToAnimatedValue for CascadeLevel
Source§type AnimatedValue = CascadeLevel
type AnimatedValue = CascadeLevel
Source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Source§impl ToComputedValue for CascadeLevel
impl ToComputedValue for CascadeLevel
Source§type ComputedValue = CascadeLevel
type ComputedValue = CascadeLevel
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Context.Source§impl ToResolvedValue for CascadeLevel
impl ToResolvedValue for CascadeLevel
Source§type ResolvedValue = CascadeLevel
type ResolvedValue = CascadeLevel
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Source§impl ToShmem for CascadeLevel
impl ToShmem for CascadeLevel
impl Copy for CascadeLevel
impl Eq for CascadeLevel
impl StructuralPartialEq for CascadeLevel
Auto Trait Implementations§
impl Freeze for CascadeLevel
impl RefUnwindSafe for CascadeLevel
impl Send for CascadeLevel
impl Sync for CascadeLevel
impl Unpin for CascadeLevel
impl UnwindSafe for CascadeLevel
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§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