Bug 1356941 - Check animation_value_type is not 'discrete' instead of 'normal' for ComputeDistance. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 24 Apr 2017 15:03:42 +0900
changeset 566918 eabf6ada981eae11278f9d8984ce717d9d74d3d4
parent 566917 705cc06350464b8042e95b47f08a5effcd7efd1e
child 566919 8a181e3323c585c8d9084c2a0e7a89c9648c533b
push id55379
push userhikezoe@mozilla.com
push dateMon, 24 Apr 2017 06:04:15 +0000
reviewersboris
bugs1356941
milestone55.0a1
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
servo/components/style/properties/helpers/animated_properties.mako.rs
--- 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(())