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

@ -14,6 +14,7 @@ use properties::ComputedValues;
use properties::longhands::display::computed_value as display;
use rule_tree::StrongRuleNode;
use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage};
use selectors::NthIndexCache;
use servo_arc::Arc;
use shared_lock::StylesheetGuards;
use std::fmt;
@ -236,6 +237,7 @@ impl ElementData {
element: E,
shared_context: &SharedStyleContext,
stack_limit_checker: Option<&StackLimitChecker>,
nth_index_cache: Option<&mut NthIndexCache>,
) -> InvalidationResult {
// In animation-only restyle we shouldn't touch snapshot at all.
if shared_context.traversal_flags.for_animation_only() {
@ -261,7 +263,9 @@ impl ElementData {
Some(self),
shared_context,
stack_limit_checker,
nth_index_cache,
);
let result = invalidator.invalidate();
unsafe { element.set_handled_snapshot() }
debug_assert!(element.handled_snapshot());