pub trait PseudoElement: Sized + ToCss {
type Impl: SelectorImpl;
// Provided methods
fn accepts_state_pseudo_classes(&self) -> bool { ... }
fn valid_after_slotted(&self) -> bool { ... }
fn valid_after_before_or_after(&self) -> bool { ... }
fn is_element_backed(&self) -> bool { ... }
fn is_before_or_after(&self) -> bool { ... }
fn specificity_count(&self) -> u32 { ... }
fn is_in_pseudo_element_tree(&self) -> bool { ... }
}
Expand description
A trait that represents a pseudo-element.
Required Associated Types§
Sourcetype Impl: SelectorImpl
type Impl: SelectorImpl
The SelectorImpl
this pseudo-element is used for.
Provided Methods§
Sourcefn accepts_state_pseudo_classes(&self) -> bool
fn accepts_state_pseudo_classes(&self) -> bool
Whether the pseudo-element supports a given state selector to the right of it.
Sourcefn valid_after_slotted(&self) -> bool
fn valid_after_slotted(&self) -> bool
Whether this pseudo-element is valid after a ::slotted(..) pseudo.
Sourcefn valid_after_before_or_after(&self) -> bool
fn valid_after_before_or_after(&self) -> bool
Whether this pseudo-element is valid when directly after a ::before/::after pseudo.
Sourcefn is_element_backed(&self) -> bool
fn is_element_backed(&self) -> bool
Whether this pseudo-element is element-backed. https://drafts.csswg.org/css-pseudo-4/#element-like
Sourcefn is_before_or_after(&self) -> bool
fn is_before_or_after(&self) -> bool
Whether this pseudo-element is ::before or ::after pseudo element, which are treated specially when deciding what can come after them. https://drafts.csswg.org/css-pseudo-4/#generated-content
Sourcefn specificity_count(&self) -> u32
fn specificity_count(&self) -> u32
The count we contribute to the specificity from this pseudo-element.
Sourcefn is_in_pseudo_element_tree(&self) -> bool
fn is_in_pseudo_element_tree(&self) -> bool
Whether this pseudo-element is in a pseudo-element tree (excluding the pseudo-element root). https://drafts.csswg.org/css-view-transitions-1/#pseudo-root
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.