From b493565cc168aed9ae7b1fafcae8c6878bce0b5a Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 20 Oct 2016 09:47:18 -0700 Subject: [PATCH] Stop ticking animations on non-dirty nodes during traversal. --- components/script/script_thread.rs | 3 +++ components/style/traversal.rs | 12 ------------ .../meta/css/animations/basic-transition.html.ini | 2 ++ 3 files changed, 5 insertions(+), 12 deletions(-) create mode 100644 tests/wpt/mozilla/meta/css/animations/basic-transition.html.ini diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 73a3d1458d8..14c0d6a840b 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1536,6 +1536,9 @@ impl ScriptThread { let node = unsafe { node.get_jsmanaged().get_for_script() }; let window = window_from_node(node); + // Not quite the right thing - see #13865. + node.dirty(NodeDamage::NodeStyleDamaged); + if let Some(el) = node.downcast::() { if &*window.GetComputedStyle(el, None).Display() == "none" { return; diff --git a/components/style/traversal.rs b/components/style/traversal.rs index e20054ec2c8..05033730753 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -4,7 +4,6 @@ //! Traversing the DOM tree; the bloom filter. -use animation; use context::{LocalStyleContext, SharedStyleContext, StyleContext}; use dom::{OpaqueNode, TNode, UnsafeNode}; 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); } } - } 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(); diff --git a/tests/wpt/mozilla/meta/css/animations/basic-transition.html.ini b/tests/wpt/mozilla/meta/css/animations/basic-transition.html.ini new file mode 100644 index 00000000000..8d564f4e839 --- /dev/null +++ b/tests/wpt/mozilla/meta/css/animations/basic-transition.html.ini @@ -0,0 +1,2 @@ +[basic-transition.html] + disabled: https://github.com/servo/servo/issues/13865