style: Split the invalidation collection from the invalidator step.

This is the first step in reusing the invalidation machinery for other stuff,
potentially including QuerySelector / QuerySelectorAll.
This commit is contained in:
Emilio Cobos Álvarez 2017-10-12 13:32:40 +02:00
parent ec00c660f0
commit b9b3e592dd
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 462 additions and 384 deletions

View file

@ -244,6 +244,7 @@ impl ElementData {
return InvalidationResult::empty();
}
use invalidation::element::collector::StateAndAttrInvalidationCollector;
use invalidation::element::invalidator::TreeStyleInvalidator;
debug!("invalidate_style_if_needed: {:?}, flags: {:?}, has_snapshot: {}, \
@ -266,7 +267,8 @@ impl ElementData {
nth_index_cache,
);
let result = invalidator.invalidate();
let result =
invalidator.invalidate::<StateAndAttrInvalidationCollector>();
unsafe { element.set_handled_snapshot() }
debug_assert!(element.handled_snapshot());
result