style: Allow passing an nth-index-cache to the invalidation code.

This commit is contained in:
Emilio Cobos Álvarez 2017-10-02 10:56:48 +02:00
parent e13f5a656a
commit aba1cf8cd5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 114 additions and 73 deletions

View file

@ -169,8 +169,11 @@ pub trait DomTraversal<E: TElement> : Sync {
if !traversal_flags.for_animation_only() {
// Invalidate our style, and that of our siblings and
// descendants as needed.
//
// FIXME(emilio): an nth-index cache could be worth here, even
// if temporary?
let invalidation_result =
data.invalidate_style_if_needed(root, shared_context, None);
data.invalidate_style_if_needed(root, shared_context, None, None);
if invalidation_result.has_invalidated_siblings() {
let actual_root =
@ -895,7 +898,8 @@ where
child_data.invalidate_style_if_needed(
child,
&context.shared,
Some(&context.thread_local.stack_limit_checker)
Some(&context.thread_local.stack_limit_checker),
Some(&mut context.thread_local.nth_index_cache)
);
}