Expand description
Code for invalidations due to state or attribute changes.
StructsΒ§
- Additional
Relative Selector Invalidation Map - 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.
- Document
State Dependency - The same, but for document state selectors.
- Invalidation
Map - A map where we store invalidations.
- Next
Dependency πEntry - PerCompound
State π - Relative
Selector πCompound State Attributes - Relative
Selector πDependency Collector - A struct that collects invalidations for a given compound selector.
- Relative
Selector πInner Collector State - Scope
Selector πCollector State - Selector
Dependency πCollector - A struct that collects invalidations for a given compound selector.
- State
Dependency - The same, but for state selectors, which can track more exactly what state do they track.
- TSState
Dependency - Dependency for tree-structural pseudo-classes.
- TSState
ForInvalidation - 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Β§
- Component
Visit πResult - Dependency
Invalidation Kind - Invalidation kind merging normal and relative dependencies.
- Normal
Dependency Invalidation Kind - The kind of elements down the tree this dependency may affect.
- Relative
Dependency Invalidation Kind - 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Β§
- AnyDependency
Map - Dependency mapping for * selectors.
- Custom
State Dependency Map - Dependency mapping for customstates
- IdOr
Class Dependency Map - Dependency mapping for classes or IDs.
- Local
Name Dependency Map - Dependency mapping for local names.
- Next
Selectors π - State
Dependency Map - Dependency mapping for non-tree-strctural pseudo-class states.
- TSState
Dependency Map - Dependency mapping for tree-structural pseudo-class states.