Bug 1356941 - Check animation_value_type is not 'discrete' instead of 'normal' for ComputeDistance. r?boris
We will introduce various new animation_value_type in subsequent patches,
so we should just check 'discrete' type for properties that we can't compute
distance.
MozReview-Commit-ID: 1iOwiBgDir0
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -2095,17 +2095,17 @@ impl Interpolate for IntermediateRGBA {
/// We support ComputeDistance for an API in gecko to test the transition per property.
impl ComputeDistance for AnimationValue {
fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
match (self, other) {
% for prop in data.longhands:
% if prop.animatable:
- % if prop.animation_value_type == "normal":
+ % if prop.animation_value_type != "discrete":
(&AnimationValue::${prop.camel_case}(ref from),
&AnimationValue::${prop.camel_case}(ref to)) => {
from.compute_distance(to)
},
% else:
(&AnimationValue::${prop.camel_case}(ref _from),
&AnimationValue::${prop.camel_case}(ref _to)) => {
Err(())