Skip to main content

CSSRule

Struct CSSRule 

Source
pub struct CSSRule {
Show 14 fields pub styleSheetId: Option<StyleSheetId>, pub selectorList: SelectorList, pub nestingSelectors: Option<Vec<String>>, pub origin: StyleSheetOrigin, pub style: CSSStyle, pub originTreeScopeNodeId: Option<BackendNodeId>, pub media: Option<Vec<CSSMedia>>, pub containerQueries: Option<Vec<CSSContainerQuery>>, pub supports: Option<Vec<CSSSupports>>, pub layers: Option<Vec<CSSLayer>>, pub scopes: Option<Vec<CSSScope>>, pub ruleTypes: Option<Vec<CSSRuleType>>, pub startingStyles: Option<Vec<CSSStartingStyle>>, pub navigations: Option<Vec<CSSNavigation>>,
}
Expand description

CSS rule representation.

Fields§

§styleSheetId: Option<StyleSheetId>

The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.

§selectorList: SelectorList

Rule selector data.

§nestingSelectors: Option<Vec<String>>

Array of selectors from ancestor style rules, sorted by distance from the current rule.

§origin: StyleSheetOrigin

Parent stylesheet’s origin.

§style: CSSStyle

Associated style declaration.

§originTreeScopeNodeId: Option<BackendNodeId>

The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule.

§media: Option<Vec<CSSMedia>>

Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.

§containerQueries: Option<Vec<CSSContainerQuery>>

Container query list array (for rules involving container queries). The array enumerates container queries starting with the innermost one, going outwards.

§supports: Option<Vec<CSSSupports>>

@supports CSS at-rule array. The array enumerates @supports at-rules starting with the innermost one, going outwards.

§layers: Option<Vec<CSSLayer>>

Cascade layer array. Contains the layer hierarchy that this rule belongs to starting with the innermost layer and going outwards.

§scopes: Option<Vec<CSSScope>>

@scope CSS at-rule array. The array enumerates @scope at-rules starting with the innermost one, going outwards.

§ruleTypes: Option<Vec<CSSRuleType>>

The array keeps the types of ancestor CSSRules from the innermost going outwards.

§startingStyles: Option<Vec<CSSStartingStyle>>

@starting-style CSS at-rule array. The array enumerates @starting-style at-rules starting with the innermost one, going outwards.

§navigations: Option<Vec<CSSNavigation>>

@navigation CSS at-rule array. The array enumerates @navigation at-rules starting with the innermost one, going outwards.

Trait Implementations§

Source§

impl Clone for CSSRule

Source§

fn clone(&self) -> CSSRule

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CSSRule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CSSRule

Source§

fn default() -> CSSRule

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CSSRule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CSSRule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,