Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Split the invalidation processing from the invalidator step. #18847

Merged
merged 7 commits into from Oct 13, 2017
5 changes: 5 additions & 0 deletions components/style/data.rs
Expand Up @@ -244,6 +244,7 @@ impl ElementData {
return InvalidationResult::empty();
}

use invalidation::element::collector::StateAndAttrInvalidationProcessor;
use invalidation::element::invalidator::TreeStyleInvalidator;

debug!("invalidate_style_if_needed: {:?}, flags: {:?}, has_snapshot: {}, \
Expand All @@ -258,17 +259,21 @@ impl ElementData {
return InvalidationResult::empty();
}

let mut processor = StateAndAttrInvalidationProcessor;
let invalidator = TreeStyleInvalidator::new(
element,
Some(self),
shared_context,
stack_limit_checker,
nth_index_cache,
&mut processor,
);

let result = invalidator.invalidate();

unsafe { element.set_handled_snapshot() }
debug_assert!(element.handled_snapshot());

result
}

Expand Down