style: Bump the selector lenght heuristic. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 27 Oct 2017 14:01:18 +0200
changeset 687757 02719baa0563f01ab4539c7d8f7265043dd6038e
parent 687756 c9cb85e4e9186044ca58494423dd7a157ef030de
child 687758 2a4639517b71b21e34a851695cfe1a952999b3ab
push id86596
push userbmo:emilio@crisal.io
push dateFri, 27 Oct 2017 18:18:19 +0000
milestone58.0a1
style: Bump the selector lenght heuristic. A selector with combinators has to have length > 2 (a component, a combinator, another component). MozReview-Commit-ID: GvMEbRdOVi2
servo/components/style/dom_apis.rs
--- a/servo/components/style/dom_apis.rs
+++ b/servo/components/style/dom_apis.rs
@@ -526,17 +526,17 @@ where
     //
     // See the comment in collect_invalidations to see why only if we're a root.
     //
     // The invalidation mechanism is only useful in presence of combinators.
     //
     // We could do that check properly here, though checking the length of the
     // selectors is a good heuristic.
     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>(
             root,
             selector_list,
             results,
             &mut matching_context,
         );