PseudoElement

Enum PseudoElement 

Source
#[repr(usize)]
pub enum PseudoElement {
Show 18 variants After = 0, Before = 1, Selection = 2, FirstLetter = 3, Backdrop = 4, DetailsSummary = 5, DetailsContent = 6, Marker = 7, ColorSwatch = 8, Placeholder = 9, ServoTextControlInnerContainer = 10, ServoTextControlInnerEditor = 11, ServoAnonymousBox = 12, ServoAnonymousTable = 13, ServoAnonymousTableCell = 14, ServoAnonymousTableRow = 15, ServoTableGrid = 16, ServoTableWrapper = 17,
}
Expand description

A pseudo-element, both public and private.

NB: If you add to this list, be sure to update each_simple_pseudo_element too.

Variants§

§

After = 0

§

Before = 1

§

Selection = 2

§

FirstLetter = 3

§

Backdrop = 4

§

DetailsSummary = 5

§

DetailsContent = 6

§

Marker = 7

§

ColorSwatch = 8

§

Placeholder = 9

§

ServoTextControlInnerContainer = 10

§

ServoTextControlInnerEditor = 11

§

ServoAnonymousBox = 12

§

ServoAnonymousTable = 13

§

ServoAnonymousTableCell = 14

§

ServoAnonymousTableRow = 15

§

ServoTableGrid = 16

§

ServoTableWrapper = 17

Implementations§

Source§

impl PseudoElement

Source

pub fn eager_index(&self) -> usize

Gets the canonical index of this eagerly-cascaded pseudo-element.

Source

pub fn index(&self) -> usize

An index for this pseudo-element to be indexed in an enumerated array.

Source

pub fn pseudo_none_array<T>() -> [Option<T>; 18]

An array of None, one per pseudo-element.

Source

pub fn from_eager_index(i: usize) -> Self

Creates a pseudo-element from an eager index.

Source

pub fn is_before_or_after(&self) -> bool

Whether the current pseudo element is ::before or ::after.

Source

pub fn is_unknown_webkit_pseudo_element(&self) -> bool

Whether this is an unknown ::-webkit- pseudo-element.

Source

pub fn is_marker(&self) -> bool

Whether this pseudo-element is the ::marker pseudo.

Source

pub fn is_selection(&self) -> bool

Whether this pseudo-element is the ::selection pseudo.

Source

pub fn is_before(&self) -> bool

Whether this pseudo-element is the ::before pseudo.

Source

pub fn is_after(&self) -> bool

Whether this pseudo-element is the ::after pseudo.

Source

pub fn is_first_letter(&self) -> bool

Whether the current pseudo element is :first-letter

Source

pub fn is_first_line(&self) -> bool

Whether the current pseudo element is :first-line

Source

pub fn is_color_swatch(&self) -> bool

Whether this pseudo-element is representing the color swatch inside an <input> element.

Source

pub fn is_eager(&self) -> bool

Whether this pseudo-element is eagerly-cascaded.

Source

pub fn is_lazy(&self) -> bool

Whether this pseudo-element is lazily-cascaded.

Source

pub fn is_anon_box(&self) -> bool

Whether this pseudo-element is for an anonymous box.

Source

pub fn skip_item_display_fixup(&self) -> bool

Whether this pseudo-element skips flex/grid container display-based fixup.

Source

pub fn is_precomputed(&self) -> bool

Whether this pseudo-element is precomputed.

Source

pub fn cascade_type(&self) -> PseudoElementCascadeType

Returns which kind of cascade type has this pseudo.

See the documentation for PseudoElementCascadeType for how we choose which cascade type to use.

Note: Keep eager pseudos in sync with EAGER_PSEUDO_COUNT and EMPTY_PSEUDO_ARRAY in style/data.rs

Source

pub fn canonical(&self) -> PseudoElement

Covert non-canonical pseudo-element to canonical one, and keep a canonical one as it is.

Source

pub fn pseudo_info(&self)

Stub, only Gecko needs this

Source

pub fn property_restriction(&self) -> Option<PropertyFlags>

Property flag that properties must have to apply to this pseudo-element.

Source

pub fn should_exist(&self, style: &ComputedValues) -> bool

Whether this pseudo-element should actually exist if it has the given styles.

Source

pub fn is_highlight(&self) -> bool

Whether this pseudo-element is the ::highlight pseudo.

Source

pub fn is_target_text(&self) -> bool

Whether this pseudo-element is the ::target-text pseudo.

Source

pub fn is_lazy_painted_highlight_pseudo(&self) -> bool

Whether this is a highlight pseudo-element that is styled lazily during painting rather than during the restyle traversal. These pseudos need explicit repaint triggering when their styles change.

Trait Implementations§

Source§

impl Clone for PseudoElement

Source§

fn clone(&self) -> PseudoElement

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 PseudoElement

Source§

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

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

impl<'de> Deserialize<'de> for PseudoElement

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 Hash for PseudoElement

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl MallocSizeOf for PseudoElement

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl PartialEq for PseudoElement

Source§

fn eq(&self, other: &PseudoElement) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PseudoElement for PseudoElement

Source§

type Impl = SelectorImpl

The SelectorImpl this pseudo-element is used for.
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
Source§

impl Serialize for PseudoElement

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

impl ToCss for PseudoElement

Source§

fn to_css<W>(&self, dest: &mut W) -> Result
where W: Write,

Serialize self in CSS syntax, writing to dest.
Source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
Source§

impl ToShmem for PseudoElement

Source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
Source§

impl Copy for PseudoElement

Source§

impl Eq for PseudoElement

Source§

impl StructuralPartialEq for PseudoElement

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T