style: Avoid looping through every selector more than twice.

I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though) with the slow rebuild
times.
This commit is contained in:
Emilio Cobos Álvarez 2017-08-02 00:05:25 +02:00
parent 4d71eed898
commit fc77f1fe31
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 167 additions and 171 deletions

View file

@ -20,7 +20,7 @@ use style::selector_parser::{SelectorImpl, SelectorParser};
use style::shared_lock::SharedRwLock;
use style::stylesheets::StyleRule;
use style::stylist::{Stylist, Rule};
use style::stylist::needs_revalidation;
use style::stylist::needs_revalidation_for_testing;
use style::thread_state;
/// Helper method to get some Rules from selector strings.
@ -126,7 +126,7 @@ fn test_revalidation_selectors() {
// Selectors in the ancestor chain (needed for cousin sharing).
"p:first-child span",
]).into_iter()
.filter(|s| needs_revalidation(&s))
.filter(|s| needs_revalidation_for_testing(&s))
.collect::<Vec<_>>();
let reference = parse_selectors(&[