Bug 1343751 - Skip animation and transition process in servo side. r?emilio draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 03 Mar 2017 06:52:52 +0900
changeset 492185 e100d61f535b894a5dbe9def5a0da4fce06b34d8
parent 492184 b07f36512778ec73575a0b024052fc287aaeb5c0
child 492186 66fe1b5a06c0fa05d6b3b23eefd52b49d3a0f7f4
push id47550
push userhikezoe@mozilla.com
push dateThu, 02 Mar 2017 21:55:07 +0000
reviewersemilio
bugs1343751, 1341985, 1341372
milestone54.0a1
Bug 1343751 - Skip animation and transition process in servo side. r?emilio Otherwise they trigger their animations and transitions. We will introduce gecko's own process in bug 1341985 (animations) and bug 1341372 (transitions). MozReview-Commit-ID: LefMmoBwGdb
servo/components/style/matching.rs
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -571,39 +571,41 @@ trait PrivateMatchMethods: TElement {
             pseudo_style.as_mut().map_or_else(|| primary_style.values.take(), |p| p.1.values.take());
 
         // Compute the new values.
         let mut new_values = self.cascade_internal(context, primary_style,
                                                    &mut pseudo_style, &booleans);
 
         // Handle animations.
         if booleans.animate {
-            if let Some(ref mut old) = old_values {
-                self.update_animations_for_cascade(shared_context, old,
-                                                   possibly_expired_animations);
-            }
+            if cfg!(feature = "servo") {
+                if let Some(ref mut old) = old_values {
+                    self.update_animations_for_cascade(shared_context, old,
+                                                       possibly_expired_animations);
+                }
 
-            let new_animations_sender = &context.thread_local.new_animations_sender;
-            let this_opaque = self.as_node().opaque();
-            // Trigger any present animations if necessary.
-            animation::maybe_start_animations(&shared_context,
-                                              new_animations_sender,
-                                              this_opaque, &new_values);
+                let new_animations_sender = &context.thread_local.new_animations_sender;
+                let this_opaque = self.as_node().opaque();
+                // Trigger any present animations if necessary.
+                animation::maybe_start_animations(&shared_context,
+                                                  new_animations_sender,
+                                                  this_opaque, &new_values);
 
-            // Trigger transitions if necessary. This will reset `new_values` back
-            // to its old value if it did trigger a transition.
-            if let Some(ref values) = old_values {
-                animation::start_transitions_if_applicable(
-                    new_animations_sender,
-                    this_opaque,
-                    self.as_node().to_unsafe(),
-                    &**values,
-                    &mut new_values,
-                    &shared_context.timer,
-                    &possibly_expired_animations);
+                // Trigger transitions if necessary. This will reset `new_values` back
+                // to its old value if it did trigger a transition.
+                if let Some(ref values) = old_values {
+                    animation::start_transitions_if_applicable(
+                        new_animations_sender,
+                        this_opaque,
+                        self.as_node().to_unsafe(),
+                        &**values,
+                        &mut new_values,
+                        &shared_context.timer,
+                        &possibly_expired_animations);
+                }
             }
         }
 
         // Accumulate restyle damage.
         if let Some(old) = old_values {
             self.accumulate_damage(restyle.unwrap(), &old, &new_values, pseudo);
         }