style: avoid selector refcount churn during invalidation.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-10-21 17:56:45 +02:00
parent 258efb70df
commit 1b32709d95
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 103 additions and 79 deletions

View file

@ -17,6 +17,7 @@ use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage};
use selectors::NthIndexCache;
use servo_arc::Arc;
use shared_lock::StylesheetGuards;
use smallvec::SmallVec;
use std::fmt;
use std::mem;
use std::ops::{Deref, DerefMut};
@ -259,8 +260,14 @@ impl ElementData {
return InvalidationResult::empty();
}
let mut xbl_stylists = SmallVec::<[_; 3]>::new();
let cut_off_inheritance =
element.each_xbl_stylist(|s| xbl_stylists.push(s));
let mut processor = StateAndAttrInvalidationProcessor::new(
shared_context,
&xbl_stylists,
cut_off_inheritance,
element,
self,
nth_index_cache,