pub struct CSSRule<'a> { /* private fields */ }Expand description
CSS rule representation.
Implementations§
Source§impl<'a> CSSRule<'a>
impl<'a> CSSRule<'a>
Sourcepub fn builder(
selector_list: SelectorList<'a>,
origin: impl Into<StyleSheetOrigin>,
style: CSSStyle<'a>,
) -> CSSRuleBuilder<'a>
pub fn builder( selector_list: SelectorList<'a>, origin: impl Into<StyleSheetOrigin>, style: CSSStyle<'a>, ) -> CSSRuleBuilder<'a>
Creates a builder for this type with the required parameters:
selector_list: Rule selector data.origin: Parent stylesheet’s origin.style: Associated style declaration.
Sourcepub fn style_sheet_id(&self) -> Option<&StyleSheetId<'a>>
pub fn style_sheet_id(&self) -> Option<&StyleSheetId<'a>>
The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
Sourcepub fn selector_list(&self) -> &SelectorList<'a>
pub fn selector_list(&self) -> &SelectorList<'a>
Rule selector data.
Sourcepub fn nesting_selectors(&self) -> Option<&[Cow<'a, str>]>
pub fn nesting_selectors(&self) -> Option<&[Cow<'a, str>]>
Array of selectors from ancestor style rules, sorted by distance from the current rule.
Sourcepub fn origin(&self) -> &StyleSheetOrigin
pub fn origin(&self) -> &StyleSheetOrigin
Parent stylesheet’s origin.
Sourcepub fn origin_tree_scope_node_id(&self) -> Option<&BackendNodeId>
pub fn origin_tree_scope_node_id(&self) -> Option<&BackendNodeId>
The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.
Sourcepub fn media(&self) -> Option<&[CSSMedia<'a>]>
pub fn media(&self) -> Option<&[CSSMedia<'a>]>
Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
Sourcepub fn container_queries(&self) -> Option<&[CSSContainerQuery<'a>]>
pub fn container_queries(&self) -> Option<&[CSSContainerQuery<'a>]>
Container query list array (for rules involving container queries). The array enumerates container queries starting with the innermost one, going outwards.
Sourcepub fn supports(&self) -> Option<&[CSSSupports<'a>]>
pub fn supports(&self) -> Option<&[CSSSupports<'a>]>
@supports CSS at-rule array. The array enumerates @supports at-rules starting with the innermost one, going outwards.
Sourcepub fn layers(&self) -> Option<&[CSSLayer<'a>]>
pub fn layers(&self) -> Option<&[CSSLayer<'a>]>
Cascade layer array. Contains the layer hierarchy that this rule belongs to starting with the innermost layer and going outwards.
Sourcepub fn scopes(&self) -> Option<&[CSSScope<'a>]>
pub fn scopes(&self) -> Option<&[CSSScope<'a>]>
@scope CSS at-rule array. The array enumerates @scope at-rules starting with the innermost one, going outwards.
Sourcepub fn rule_types(&self) -> Option<&[CSSRuleType]>
pub fn rule_types(&self) -> Option<&[CSSRuleType]>
The array keeps the types of ancestor CSSRules from the innermost going outwards.
Sourcepub fn starting_styles(&self) -> Option<&[CSSStartingStyle<'a>]>
pub fn starting_styles(&self) -> Option<&[CSSStartingStyle<'a>]>
@starting-style CSS at-rule array. The array enumerates @starting-style at-rules starting with the innermost one, going outwards.
@navigation CSS at-rule array. The array enumerates @navigation at-rules starting with the innermost one, going outwards.