Bug 1420928 - Check each animation sub property count in animations_equals. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 04 Jan 2018 18:24:25 +0900
changeset 715628 ccf0ef10cd21130964e6ff4220f77096e1333ff9
parent 715627 43b597c395b4e8943454cfa7c7629af1471d4d2c
child 715629 9872b521f64c290eb6a24a4761ba80f6ce232b88
push id94212
push userhikezoe@mozilla.com
push dateThu, 04 Jan 2018 09:34:32 +0000
reviewersboris
bugs1420928
milestone59.0a1
Bug 1420928 - Check each animation sub property count in animations_equals. r?boris In a subsequent patch, we will no longer fill out deficient property values in mAnimations. MozReview-Commit-ID: 7O1JjEZ2eDH
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3385,17 +3385,25 @@ fn static_assert() {
 
     pub fn reset_transition_property(&mut self, other: &Self) {
         self.copy_transition_property_from(other)
     }
 
     ${impl_transition_count('property', 'Property')}
 
     pub fn animations_equals(&self, other: &Self) -> bool {
-        unsafe { bindings::Gecko_StyleAnimationsEquals(&self.gecko.mAnimations, &other.gecko.mAnimations) }
+        return self.gecko.mAnimationNameCount == other.gecko.mAnimationNameCount
+            && self.gecko.mAnimationDelayCount == other.gecko.mAnimationDelayCount
+            && self.gecko.mAnimationDirectionCount == other.gecko.mAnimationDirectionCount
+            && self.gecko.mAnimationDurationCount == other.gecko.mAnimationDurationCount
+            && self.gecko.mAnimationFillModeCount == other.gecko.mAnimationFillModeCount
+            && self.gecko.mAnimationIterationCountCount == other.gecko.mAnimationIterationCountCount
+            && self.gecko.mAnimationPlayStateCount == other.gecko.mAnimationPlayStateCount
+            && self.gecko.mAnimationTimingFunctionCount == other.gecko.mAnimationTimingFunctionCount
+            && unsafe { bindings::Gecko_StyleAnimationsEquals(&self.gecko.mAnimations, &other.gecko.mAnimations) }
     }
 
     pub fn set_animation_name<I>(&mut self, v: I)
         where I: IntoIterator<Item = longhands::animation_name::computed_value::single_value::T>,
               I::IntoIter: ExactSizeIterator
     {
         let v = v.into_iter();
         debug_assert!(v.len() != 0);