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
--- 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);
}