style: Bump the selector length heuristic.

A selector with combinators has to have length > 2 (a component, a combinator,
another component).

MozReview-Commit-ID: GvMEbRdOVi2
This commit is contained in:
Emilio Cobos Álvarez 2017-10-27 14:01:18 +02:00
parent eea8ecd345
commit 9a378a89b4
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -557,8 +557,11 @@ where
//
// We could do that check properly here, though checking the length of the
// selectors is a good heuristic.
//
// A selector with a combinator needs to have a length of at least 3: A
// simple selector, a combinator, and another simple selector.
let invalidation_may_be_useful =
selector_list.0.iter().any(|s| s.len() > 1);
selector_list.0.iter().any(|s| s.len() > 2);
if root_element.is_some() || !invalidation_may_be_useful {
query_selector_slow::<E, Q>(