From c316594bd36a5c3a0432263da6c38c63a3473380 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 11 Apr 2017 16:31:58 +0900 Subject: [PATCH 1/2] Rename cascade_with_replacements to replace_rules. That's because the function does not invoke cascade() at all. --- components/style/matching.rs | 10 +++++----- components/style/traversal.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/style/matching.rs b/components/style/matching.rs index 7fab97d7d7a..0c50445b40d 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -906,11 +906,11 @@ pub trait MatchMethods : TElement { /// Updates the rule nodes without re-running selector matching, using just /// the rule tree. Returns true if the rule nodes changed. - fn cascade_with_replacements(&self, - hint: RestyleHint, - context: &StyleContext, - data: &mut AtomicRefMut) - -> bool { + fn replace_rules(&self, + hint: RestyleHint, + context: &StyleContext, + data: &mut AtomicRefMut) + -> bool { use properties::PropertyDeclarationBlock; use shared_lock::Locked; diff --git a/components/style/traversal.rs b/components/style/traversal.rs index a258125652c..67828e6a7ec 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -711,7 +711,7 @@ fn compute_style(_traversal: &D, } CascadeWithReplacements(hint) => { let _rule_nodes_changed = - element.cascade_with_replacements(hint, context, &mut data); + element.replace_rules(hint, context, &mut data); element.cascade_primary_and_pseudos(context, &mut data); } CascadeOnly => { From 27405bd0b69b60cdd807cb3b1a3d33bddbdf0151 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 11 Apr 2017 16:32:11 +0900 Subject: [PATCH 2/2] Don't call process_animations during animation-only restyles. --- components/style/matching.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/matching.rs b/components/style/matching.rs index 0c50445b40d..2f2468413f5 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -433,7 +433,7 @@ trait PrivateMatchMethods: TElement { &pseudo_style); // Handle animations. - if animate { + if animate && !context.shared.traversal_flags.for_animation_only() { self.process_animations(context, &mut old_values, &mut new_values,