Type Alias style::invalidation::element::invalidation_map::TSStateDependencyMap
source · pub type TSStateDependencyMap = SelectorMap<TSStateDependency>;
Expand description
Dependency mapping for tree-structural pseudo-class states.
Aliased Type§
struct TSStateDependencyMap {
pub root: SmallVec<[TSStateDependency; 1]>,
pub id_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[TSStateDependency; 1]>>,
pub class_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[TSStateDependency; 1]>>,
pub local_name_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub attribute_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub namespace_hash: HashMap<GenericAtomIdent<NamespaceStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub rare_pseudo_classes: SmallVec<[TSStateDependency; 1]>,
pub other: SmallVec<[TSStateDependency; 1]>,
pub count: usize,
}
Fields§
§root: SmallVec<[TSStateDependency; 1]>
Rules that have :root
selectors.
id_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[TSStateDependency; 1]>>
A hash from an ID to rules which contain that ID selector.
class_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[TSStateDependency; 1]>>
A hash from a class name to rules which contain that class selector.
local_name_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from local name to rules which contain that local name selector.
attribute_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from attributes to rules which contain that attribute selector.
namespace_hash: HashMap<GenericAtomIdent<NamespaceStaticSet>, SmallVec<[TSStateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from namespace to rules which contain that namespace selector.
rare_pseudo_classes: SmallVec<[TSStateDependency; 1]>
Rules for pseudo-states that are rare but have global selectors.
other: SmallVec<[TSStateDependency; 1]>
All other rules.
count: usize
The number of entries in this map.
Implementations§
source§impl<T> SelectorMap<T>
impl<T> SelectorMap<T>
sourcepub fn shrink_if_needed(&mut self)
pub fn shrink_if_needed(&mut self)
Shrink the capacity of the map if needed.
source§impl<T: SelectorMapEntry> SelectorMap<T>
impl<T: SelectorMapEntry> SelectorMap<T>
sourcepub fn insert(
&mut self,
entry: T,
quirks_mode: QuirksMode
) -> Result<(), AllocErr>
pub fn insert( &mut self, entry: T, quirks_mode: QuirksMode ) -> Result<(), AllocErr>
Inserts an entry into the correct bucket(s).
sourcepub fn lookup<'a, E, F>(
&'a self,
element: E,
quirks_mode: QuirksMode,
relevant_attributes: Option<&mut RelevantAttributes>,
f: F
) -> boolwhere
E: TElement,
F: FnMut(&'a T) -> bool,
pub fn lookup<'a, E, F>( &'a self, element: E, quirks_mode: QuirksMode, relevant_attributes: Option<&mut RelevantAttributes>, f: F ) -> boolwhere E: TElement, F: FnMut(&'a T) -> bool,
Looks up entries by id, class, local name, namespace, and other (in order).
Each entry is passed to the callback, which returns true to continue iterating entries, or false to terminate the lookup.
Returns false if the callback ever returns false.
FIXME(bholley) This overlaps with SelectorMap
fn lookup_with_state<'a, E, F>( &'a self, element: E, element_state: ElementState, quirks_mode: QuirksMode, relevant_attributes: Option<&mut RelevantAttributes>, f: F ) -> boolwhere E: TElement, F: FnMut(&'a T) -> bool,
sourcepub fn lookup_with_additional<'a, E, F>(
&'a self,
element: E,
quirks_mode: QuirksMode,
additional_id: Option<&WeakAtom>,
additional_classes: &[Atom],
additional_states: ElementState,
f: F
) -> boolwhere
E: TElement,
F: FnMut(&'a T) -> bool,
pub fn lookup_with_additional<'a, E, F>( &'a self, element: E, quirks_mode: QuirksMode, additional_id: Option<&WeakAtom>, additional_classes: &[Atom], additional_states: ElementState, f: F ) -> boolwhere E: TElement, F: FnMut(&'a T) -> bool,
Performs a normal lookup, and also looks up entries for the passed-in id and classes.
Each entry is passed to the callback, which returns true to continue iterating entries, or false to terminate the lookup.
Returns false if the callback ever returns false.
Trait Implementations§
source§impl<T: Clone + 'static> Clone for SelectorMap<T>
impl<T: Clone + 'static> Clone for SelectorMap<T>
source§fn clone(&self) -> SelectorMap<T>
fn clone(&self) -> SelectorMap<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more