Function style::dom_apis::query_selector_fast
source · fn query_selector_fast<E, Q>(
root: E::ConcreteNode,
selector_list: &SelectorList<E::Impl>,
results: &mut Q::Output,
matching_context: &mut MatchingContext<'_, E::Impl>,
) -> Result<(), ()>where
E: TElement,
Q: SelectorQuery<E>,
Expand description
Fast paths for a given selector query.
When there’s only one component, we go directly to
query_selector_single_query
, otherwise, we try to optimize by looking just
at the subtrees rooted at ids in the selector, and otherwise we try to look
up by class name or local name in the rightmost compound.
FIXME(emilio, nbp): This may very well be a good candidate for code to be replaced by HolyJit :)