Optimize selector matching for some common cases.

This commit is contained in:
Xidorn Quan 2018-01-16 14:59:03 +11:00
parent 7de87c487b
commit d0fd92221c
2 changed files with 92 additions and 26 deletions

View file

@ -9,7 +9,7 @@ use context::StackLimitChecker;
use dom::{TElement, TNode};
use selector_parser::SelectorImpl;
use selectors::matching::{CompoundSelectorMatchingResult, MatchingContext};
use selectors::matching::matches_compound_selector;
use selectors::matching::matches_compound_selector_from;
use selectors::parser::{Combinator, Component, Selector};
use smallvec::SmallVec;
use std::fmt;
@ -691,7 +691,7 @@ where
debug!("TreeStyleInvalidator::process_invalidation({:?}, {:?}, {:?})",
self.element, invalidation, invalidation_kind);
let matching_result = matches_compound_selector(
let matching_result = matches_compound_selector_from(
&invalidation.selector,
invalidation.offset,
self.processor.matching_context(),