Skip to main content

CascadeData

Struct CascadeData 

Source
pub struct CascadeData { /* private fields */ }
Expand description

Data resulting from performing the CSS cascade that is specific to a given origin.

FIXME(emilio): Consider renaming and splitting in CascadeData and InvalidationData? That’d make clear_cascade_data() clearer.

Implementations§

Source§

impl CascadeData

Source

pub fn new() -> Self

Creates an empty CascadeData.

Source

pub fn rebuild<'a, S>( &mut self, device: &Device, quirks_mode: QuirksMode, collection: SheetCollectionFlusher<'_, S>, guard: &SharedRwLockReadGuard<'_>, difference: &mut CascadeDataDifference, ) -> Result<(), AllocErr>
where S: StylesheetInDocument + PartialEq + 'static,

Rebuild the cascade data from a given SheetCollection, incrementally if possible.

Source

pub fn custom_media_map(&self) -> &CustomMediaMap

Returns the custom media query map.

Source

pub fn invalidation_map(&self) -> &InvalidationMap

Returns the invalidation map.

Source

pub fn relative_selector_invalidation_map(&self) -> &InvalidationMap

Returns the relative selector invalidation map.

Source

pub fn relative_invalidation_map_attributes( &self, ) -> &AdditionalRelativeSelectorInvalidationMap

Returns the relative selector invalidation map data.

Source

pub fn has_state_dependency(&self, state: ElementState) -> bool

Returns whether the given ElementState bit is relied upon by a selector of some rule.

Source

pub fn has_nth_of_custom_state_dependency(&self, state: &AtomIdent) -> bool

Returns whether the given Custom State is relied upon by a selector of some rule in the selector list of :nth-child(… of ).

Source

pub fn has_nth_of_state_dependency(&self, state: ElementState) -> bool

Returns whether the given ElementState bit is relied upon by a selector of some rule in the selector list of :nth-child(… of ).

Source

pub fn might_have_attribute_dependency(&self, local_name: &LocalName) -> bool

Returns whether the given attribute might appear in an attribute selector of some rule.

Source

pub fn might_have_nth_of_id_dependency(&self, id: &Atom) -> bool

Returns whether the given ID might appear in an ID selector in the selector list of :nth-child(… of ).

Source

pub fn might_have_nth_of_class_dependency(&self, class: &Atom) -> bool

Returns whether the given class might appear in a class selector in the selector list of :nth-child(… of ).

Source

pub fn might_have_nth_of_attribute_dependency( &self, local_name: &LocalName, ) -> bool

Returns whether the given attribute might appear in an attribute selector in the selector list of :nth-child(… of ).

Source

pub fn normal_rules( &self, pseudo_elements: &[PseudoElement], ) -> Option<&SelectorMap<Rule>>

Returns the normal rule map for a given pseudo-element.

Source

pub fn featureless_host_rules( &self, pseudo_elements: &[PseudoElement], ) -> Option<&SelectorMap<Rule>>

Returns the featureless pseudo rule map for a given pseudo-element.

Source

pub fn any_featureless_host_rules(&self) -> bool

Whether there’s any featureless rule that could match in this scope.

Source

pub fn slotted_rules( &self, pseudo_elements: &[PseudoElement], ) -> Option<&SelectorMap<Rule>>

Returns the slotted rule map for a given pseudo-element.

Source

pub fn any_slotted_rule(&self) -> bool

Whether there’s any ::slotted rule that could match in this scope.

Source

pub fn part_rules( &self, pseudo_elements: &[PseudoElement], ) -> Option<&PrecomputedHashMap<Atom, SmallVec<[Rule; 1]>>>

Returns the parts rule map for a given pseudo-element.

Source

pub fn any_part_rule(&self) -> bool

Whether there’s any ::part rule that could match in this scope.

Source

pub fn media_feature_affected_matches<S>( &self, stylesheet: &S, guard: &SharedRwLockReadGuard<'_>, device: &Device, quirks_mode: QuirksMode, ) -> bool
where S: StylesheetInDocument + 'static,

Returns whether all the media-feature affected values matched before and match now in the given stylesheet.

Source

pub fn custom_property_registrations( &self, ) -> &LayerOrderedMap<Arc<PropertyRegistration>>

Returns the custom properties map.

Trait Implementations§

Source§

impl Clone for CascadeData

Source§

fn clone(&self) -> CascadeData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CascadeData

Source§

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

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

impl Default for CascadeData

Source§

fn default() -> Self

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

impl MallocSizeOf for CascadeData

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.

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> 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T