mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
style: Isolate all the restyling related logic in the invalidator in an InvalidationProcessor trait.
Ditto, no change in behavior.
This commit is contained in:
parent
b9b3e592dd
commit
a5e2f2c76c
3 changed files with 204 additions and 45 deletions
|
@ -244,7 +244,7 @@ impl ElementData {
|
|||
return InvalidationResult::empty();
|
||||
}
|
||||
|
||||
use invalidation::element::collector::StateAndAttrInvalidationCollector;
|
||||
use invalidation::element::collector::StateAndAttrInvalidationProcessor;
|
||||
use invalidation::element::invalidator::TreeStyleInvalidator;
|
||||
|
||||
debug!("invalidate_style_if_needed: {:?}, flags: {:?}, has_snapshot: {}, \
|
||||
|
@ -259,18 +259,21 @@ impl ElementData {
|
|||
return InvalidationResult::empty();
|
||||
}
|
||||
|
||||
let processor = StateAndAttrInvalidationProcessor;
|
||||
let invalidator = TreeStyleInvalidator::new(
|
||||
element,
|
||||
Some(self),
|
||||
shared_context,
|
||||
stack_limit_checker,
|
||||
nth_index_cache,
|
||||
&processor,
|
||||
);
|
||||
|
||||
let result =
|
||||
invalidator.invalidate::<StateAndAttrInvalidationCollector>();
|
||||
let result = invalidator.invalidate();
|
||||
|
||||
unsafe { element.set_handled_snapshot() }
|
||||
debug_assert!(element.handled_snapshot());
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue