pub struct ApplicableDeclarationBlock<'a> {
pub source: StyleSourceBorrow<'a>,
source_order: u32,
pub specificity: u32,
pub scope_proximity: ScopeProximity,
pub cascade_priority: CascadePriority,
}Expand description
A property declaration together with its precedence among rules of equal specificity so that we can sort them.
This represents the declarations in a given declaration block for a given importance.
Fields§
§source: StyleSourceBorrow<'a>The style source.
source_order: u32Order of appearance in which this rule appears - Set to 0 if not relevant
(e.g. Declaration from style="/*...*/", presentation hints, animations
- See
CascadePriorityinstead).
specificity: u32The specificity of the selector.
scope_proximity: ScopeProximityThe proximity to the scope root.
cascade_priority: CascadePriorityThe cascade priority of the rule.
Implementations§
Source§impl<'a> ApplicableDeclarationBlock<'a>
impl<'a> ApplicableDeclarationBlock<'a>
Sourcepub fn from_declarations(
source: StyleSourceBorrow<'a>,
level: CascadeLevel,
layer_order: LayerOrder,
) -> Self
pub fn from_declarations( source: StyleSourceBorrow<'a>, level: CascadeLevel, layer_order: LayerOrder, ) -> Self
Constructs an applicable declaration block from a given property declaration block borrow and importance.
Sourcepub fn new(
source: StyleSourceBorrow<'a>,
source_order: u32,
level: CascadeLevel,
specificity: u32,
layer_order: LayerOrder,
scope_proximity: ScopeProximity,
flags: RuleCascadeFlags,
) -> Self
pub fn new( source: StyleSourceBorrow<'a>, source_order: u32, level: CascadeLevel, specificity: u32, layer_order: LayerOrder, scope_proximity: ScopeProximity, flags: RuleCascadeFlags, ) -> Self
Constructs an applicable declaration block from the given components.
Sourcepub fn source_order(&self) -> u32
pub fn source_order(&self) -> u32
Returns the source order of the block.
Sourcepub fn level(&self) -> CascadeLevel
pub fn level(&self) -> CascadeLevel
Returns the cascade level of the block.
Sourcepub fn layer_order(&self) -> LayerOrder
pub fn layer_order(&self) -> LayerOrder
Returns the cascade level of the block.
Sourcepub fn scope_proximity(&self) -> ScopeProximity
pub fn scope_proximity(&self) -> ScopeProximity
Returns the scope proximity of the block.
Sourcepub fn for_rule_tree(self) -> (StyleSourceBorrow<'a>, CascadePriority)
pub fn for_rule_tree(self) -> (StyleSourceBorrow<'a>, CascadePriority)
Convenience method to consume self and return the right thing for the rule tree to iterate over.
Sourcepub fn sort_key(&self) -> (LayerOrder, u32, ScopeProximity, u32)
pub fn sort_key(&self) -> (LayerOrder, u32, ScopeProximity, u32)
Return the key used to sort applicable declarations.
Trait Implementations§
Source§impl<'a> Clone for ApplicableDeclarationBlock<'a>
impl<'a> Clone for ApplicableDeclarationBlock<'a>
Source§fn clone(&self) -> ApplicableDeclarationBlock<'a>
fn clone(&self) -> ApplicableDeclarationBlock<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for ApplicableDeclarationBlock<'a>
Source§impl<'a> Debug for ApplicableDeclarationBlock<'a>
impl<'a> Debug for ApplicableDeclarationBlock<'a>
Source§impl<'a> MallocSizeOf for ApplicableDeclarationBlock<'a>
impl<'a> MallocSizeOf for ApplicableDeclarationBlock<'a>
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl<'a> PartialEq for ApplicableDeclarationBlock<'a>
impl<'a> PartialEq for ApplicableDeclarationBlock<'a>
impl<'a> StructuralPartialEq for ApplicableDeclarationBlock<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ApplicableDeclarationBlock<'a>
impl<'a> !UnwindSafe for ApplicableDeclarationBlock<'a>
impl<'a> Freeze for ApplicableDeclarationBlock<'a>
impl<'a> Send for ApplicableDeclarationBlock<'a>
impl<'a> Sync for ApplicableDeclarationBlock<'a>
impl<'a> Unpin for ApplicableDeclarationBlock<'a>
impl<'a> UnsafeUnpin for ApplicableDeclarationBlock<'a>
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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