mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
eea8ecd345
commit
9a378a89b4
1 changed files with 4 additions and 1 deletions
|
@ -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>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue