Trait PseudoElement

Source
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§

Source

type Impl: SelectorImpl

The SelectorImpl this pseudo-element is used for.

Provided Methods§

Source

fn accepts_state_pseudo_classes(&self) -> bool

Whether the pseudo-element supports a given state selector to the right of it.

Source

fn valid_after_slotted(&self) -> bool

Whether this pseudo-element is valid after a ::slotted(..) pseudo.

Source

fn valid_after_before_or_after(&self) -> bool

Whether this pseudo-element is valid when directly after a ::before/::after pseudo.

Source

fn is_element_backed(&self) -> bool

Whether this pseudo-element is element-backed. https://drafts.csswg.org/css-pseudo-4/#element-like

Source

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

Source

fn specificity_count(&self) -> u32

The count we contribute to the specificity from this pseudo-element.

Source

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.

Implementors§