Bug 1330824 - Use impl_copy_animation_value for animation-timing-function. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 14 Jan 2017 08:01:25 +0900
changeset 460842 679e49d0bc2bda6bf75b0199a872ab4d27560ac9
parent 460501 41ae8bba9db4795b667314992329ee3bdce58230
child 460843 c77069e7441d6c05958882351e58a55596fb6ed3
push id41514
push userhiikezoe@mozilla-japan.org
push dateFri, 13 Jan 2017 23:27:08 +0000
reviewersheycam
bugs1330824, 1328786
milestone53.0a1
Bug 1330824 - Use impl_copy_animation_value for animation-timing-function. r?heycam I did forget to do it in bug 1328786. MozReview-Commit-ID: IDpVShW6nrH
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1427,27 +1427,21 @@ fn static_assert() {
         unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
 
         self.gecko.mAnimationTimingFunctionCount = v.0.len() as u32;
         for (servo, gecko) in v.0.into_iter().zip(self.gecko.mAnimations.iter_mut()) {
             gecko.mTimingFunction = servo.into();
         }
     }
     ${impl_animation_count('timing_function', 'TimingFunction')}
+    ${impl_copy_animation_value('timing_function', 'TimingFunction')}
     pub fn animation_timing_function_at(&self, index: usize)
         -> longhands::animation_timing_function::computed_value::SingleComputedValue {
         self.gecko.mAnimations[index].mTimingFunction.into()
     }
-    pub fn copy_animation_timing_function_from(&mut self, other: &Self) {
-        unsafe { self.gecko.mAnimations.ensure_len(other.gecko.mAnimations.len()) };
-        self.gecko.mAnimationTimingFunctionCount = other.gecko.mAnimationTimingFunctionCount;
-        for (index, animation) in self.gecko.mAnimations.iter_mut().enumerate() {
-            animation.mTimingFunction = other.gecko.mAnimations[index].mTimingFunction;
-        }
-    }
 
     <% scroll_snap_type_keyword = Keyword("scroll-snap-type", "none mandatory proximity") %>
 
     ${impl_keyword('scroll_snap_type_y', 'mScrollSnapTypeY', scroll_snap_type_keyword, need_clone=False)}
 
     pub fn set_perspective_origin(&mut self, v: longhands::perspective_origin::computed_value::T) {
         self.gecko.mPerspectiveOrigin[0].set(v.horizontal);
         self.gecko.mPerspectiveOrigin[1].set(v.vertical);