Module invalidation_map

Source
Expand description

Code for invalidations due to state or attribute changes.

StructsΒ§

AdditionalRelativeSelectorInvalidationMap
A map to store invalidation dependencies specific to relative selectors. This keeps a lot more data than the usual map, because any change can generate upward traversals that need to be handled separately.
Dependency
Mapping between (partial) CompoundSelectors (and the combinator to their right) and the states and attributes they depend on.
DocumentStateDependency
The same, but for document state selectors.
InvalidationMap
A map where we store invalidations.
NextDependencyEntry πŸ”’
PerCompoundState πŸ”’
RelativeSelectorCompoundStateAttributes πŸ”’
RelativeSelectorDependencyCollector πŸ”’
A struct that collects invalidations for a given compound selector.
RelativeSelectorInnerCollectorState πŸ”’
ScopeSelectorCollectorState πŸ”’
SelectorDependencyCollector πŸ”’
A struct that collects invalidations for a given compound selector.
StateDependency
The same, but for state selectors, which can track more exactly what state do they track.
TSStateDependency
Dependency for tree-structural pseudo-classes.
TSStateForInvalidation
Tree-structural pseudoclasses that we care about for (Relative selector) invalidation. Specifically, we need to store information on ones that don’t generate the inner selector. Given the nature of these selectors:

EnumsΒ§

ComponentVisitResult πŸ”’
DependencyInvalidationKind
Invalidation kind merging normal and relative dependencies.
NormalDependencyInvalidationKind
The kind of elements down the tree this dependency may affect.
RelativeDependencyInvalidationKind
The kind of elements up the tree this relative selector dependency may affect. Because this travels upwards, it’s not viable for parallel subtree traversal, and is handled separately.

TraitsΒ§

Collector πŸ”’

FunctionsΒ§

add_attr_dependency πŸ”’
add_custom_state_dependency πŸ”’
add_local_name πŸ”’
add_non_unique_info πŸ”’
add_pseudo_class_dependency πŸ”’
add_ts_pseudo_class_dependency πŸ”’
get_normal_invalidation_kind πŸ”’
Return the type of normal invalidation given a selector & an offset.
get_relative_kind πŸ”’
Return the relative invalidation kind given a match hint
next_dependency πŸ”’
note_selector_for_invalidation
Adds a selector to the given InvalidationMap. Returns Err(..) to signify OOM.
on_attribute πŸ”’
on_id_or_class πŸ”’
on_pseudo_class πŸ”’
on_scope πŸ”’
on_simple_selector πŸ”’
visit_all_in_iter_compound πŸ”’
Visit all the simple selectors in the iter compound and return the number of simple selectors visited. We need to return a tuple because we need to keep track of two things:

Type AliasesΒ§

AnyDependencyMap
Dependency mapping for * selectors.
CustomStateDependencyMap
Dependency mapping for customstates
IdOrClassDependencyMap
Dependency mapping for classes or IDs.
LocalNameDependencyMap
Dependency mapping for local names.
NextSelectors πŸ”’
StateDependencyMap
Dependency mapping for non-tree-strctural pseudo-class states.
TSStateDependencyMap
Dependency mapping for tree-structural pseudo-class states.