Struct style::invalidation::element::invalidation_map::InvalidationMap [] [src]

pub struct InvalidationMap {
    pub class_to_selector: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[Dependency; 1]>>,
    pub id_to_selector: MaybeCaseInsensitiveHashMap<Atom, SmallVec<[Dependency; 1]>>,
    pub state_affecting_selectors: SelectorMap<StateDependency>,
    pub other_attribute_affecting_selectors: SelectorMap<Dependency>,
    pub has_class_attribute_selectors: bool,
    pub has_id_attribute_selectors: bool,
}

A map where we store invalidations.

This is slightly different to a SelectorMap, in the sense of that the same selector may appear multiple times.

In particular, we want to lookup as few things as possible to get the fewer selectors the better, so this looks up by id, class, or looks at the list of state/other attribute affecting selectors.

Fields

A map from a given class name to all the selectors with that class selector.

A map from a given id to all the selectors with that ID in the stylesheets currently applying to the document.

A map of all the state dependencies.

A map of other attribute affecting selectors.

Whether there are attribute rules of the form [class~="foo"] that may match. In that case, we need to look at other_attribute_affecting_selectors too even if only the class has changed.

Whether there are attribute rules of the form [id|="foo"] that may match. In that case, we need to look at other_attribute_affecting_selectors too even if only the id has changed.

Methods

impl InvalidationMap
[src]

[src]

Creates an empty InvalidationMap.

[src]

Returns the number of dependencies stored in the invalidation map.

[src]

Adds a selector to this InvalidationMap. Returns Err(..) to signify OOM.

[src]

Clears this map, leaving it empty.

Trait Implementations

impl Debug for InvalidationMap
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for InvalidationMap
[src]

[src]

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