diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 8bccd5a0bfb..c81e186a129 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -768,17 +768,22 @@ animated_list_impl!( for crate::OwnedSlice); animated_list_impl!( for SmallVec<[T; 1]>); animated_list_impl!( for Vec); -/// +/// impl Animate for Visibility { #[inline] fn animate(&self, other: &Self, procedure: Procedure) -> Result { - let (this_weight, other_weight) = procedure.weights(); - match (*self, *other) { - (Visibility::Visible, _) => { - Ok(if this_weight > 0.0 { *self } else { *other }) - }, - (_, Visibility::Visible) => { - Ok(if other_weight > 0.0 { *other } else { *self }) + match procedure { + Procedure::Interpolate { .. } => { + let (this_weight, other_weight) = procedure.weights(); + match (*self, *other) { + (Visibility::Visible, _) => { + Ok(if this_weight > 0.0 { *self } else { *other }) + }, + (_, Visibility::Visible) => { + Ok(if other_weight > 0.0 { *other } else { *self }) + }, + _ => Err(()), + } }, _ => Err(()), }