From 9a378a89b433a4bddf699e69c81660a1d38d6559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 27 Oct 2017 14:01:18 +0200 Subject: [PATCH] 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 --- components/style/dom_apis.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/style/dom_apis.rs b/components/style/dom_apis.rs index bf4f571f21d..41c5c19dca8 100644 --- a/components/style/dom_apis.rs +++ b/components/style/dom_apis.rs @@ -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::(