Auto merge of #13866 - bholley:expire_animations, r=emilio

Stop ticking animations on non-dirty nodes during traversal

See #13865.

r? @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13866)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-20 21:57:54 -05:00 committed by GitHub
commit 202dfd5c27
3 changed files with 5 additions and 12 deletions

View file

@ -1536,6 +1536,9 @@ impl ScriptThread {
let node = unsafe { node.get_jsmanaged().get_for_script() }; let node = unsafe { node.get_jsmanaged().get_for_script() };
let window = window_from_node(node); let window = window_from_node(node);
// Not quite the right thing - see #13865.
node.dirty(NodeDamage::NodeStyleDamaged);
if let Some(el) = node.downcast::<Element>() { if let Some(el) = node.downcast::<Element>() {
if &*window.GetComputedStyle(el, None).Display() == "none" { if &*window.GetComputedStyle(el, None).Display() == "none" {
return; return;

View file

@ -4,7 +4,6 @@
//! Traversing the DOM tree; the bloom filter. //! Traversing the DOM tree; the bloom filter.
use animation;
use context::{LocalStyleContext, SharedStyleContext, StyleContext}; use context::{LocalStyleContext, SharedStyleContext, StyleContext};
use dom::{OpaqueNode, TNode, UnsafeNode}; use dom::{OpaqueNode, TNode, UnsafeNode};
use matching::{ApplicableDeclarations, ElementMatchMethods, MatchMethods, StyleSharingResult}; use matching::{ApplicableDeclarations, ElementMatchMethods, MatchMethods, StyleSharingResult};
@ -367,17 +366,6 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
node.set_restyle_damage(damage); node.set_restyle_damage(damage);
} }
} }
} else {
// Finish any expired transitions.
let mut existing_style = node.get_existing_style().unwrap();
let had_animations_to_expire = animation::complete_expired_transitions(
node.opaque(),
&mut existing_style,
context.shared_context()
);
if had_animations_to_expire {
node.set_style(existing_style);
}
} }
let unsafe_layout_node = node.to_unsafe(); let unsafe_layout_node = node.to_unsafe();

View file

@ -0,0 +1,2 @@
[basic-transition.html]
disabled: https://github.com/servo/servo/issues/13865