pub type StateDependencyMap = SelectorMap<StateDependency>;
Expand description
Dependency mapping for non-tree-strctural pseudo-class states.
Aliased Type§
struct StateDependencyMap {
pub root: SmallVec<[StateDependency; 1]>,
pub id_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[StateDependency; 1]>>,
pub class_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[StateDependency; 1]>>,
pub local_name_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub attribute_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub namespace_hash: HashMap<GenericAtomIdent<NamespaceStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>,
pub rare_pseudo_classes: SmallVec<[StateDependency; 1]>,
pub other: SmallVec<[StateDependency; 1]>,
pub count: usize,
}
Fields§
§root: SmallVec<[StateDependency; 1]>
Rules that have :root
selectors.
id_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[StateDependency; 1]>>
A hash from an ID to rules which contain that ID selector.
class_hash: MaybeCaseInsensitiveHashMap<Atom<AtomStaticSet>, SmallVec<[StateDependency; 1]>>
A hash from a class name to rules which contain that class selector.
local_name_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from local name to rules which contain that local name selector.
attribute_hash: HashMap<GenericAtomIdent<LocalNameStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from attributes to rules which contain that attribute selector.
namespace_hash: HashMap<GenericAtomIdent<NamespaceStaticSet>, SmallVec<[StateDependency; 1]>, BuildHasherDefault<PrecomputedHasher>>
A hash from namespace to rules which contain that namespace selector.
rare_pseudo_classes: SmallVec<[StateDependency; 1]>
Rules for pseudo-states that are rare but have global selectors.
other: SmallVec<[StateDependency; 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,
) -> bool
pub fn lookup<'a, E, F>( &'a self, element: E, quirks_mode: QuirksMode, relevant_attributes: Option<&mut RelevantAttributes>, f: F, ) -> 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, ) -> 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,
) -> 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, ) -> 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