Navigation Menu

Skip to content

Commit

Permalink
Bug 1330824 - Do not copy animation property over mAnimationXXCount. …
Browse files Browse the repository at this point in the history
…r=heycam

MozReview-Commit-ID: GeSWnPQltHf
  • Loading branch information
Hiroyuki Ikezoe committed Jan 14, 2017
1 parent f66774b commit f960b4c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -1021,8 +1021,13 @@ fn static_assert() {
#[allow(non_snake_case)]
pub fn copy_animation_${ident}_from(&mut self, other: &Self) {
unsafe { self.gecko.mAnimations.ensure_len(other.gecko.mAnimations.len()) };
self.gecko.mAnimation${gecko_ffi_name}Count = other.gecko.mAnimation${gecko_ffi_name}Count;
for (index, animation) in self.gecko.mAnimations.iter_mut().enumerate() {

let count = other.gecko.mAnimation${gecko_ffi_name}Count;
self.gecko.mAnimation${gecko_ffi_name}Count = count;

// The length of mAnimations is often greater than mAnimationXXCount,
// don't copy values over the count.
for (index, animation) in self.gecko.mAnimations.iter_mut().enumerate().take(count as usize) {
animation.m${gecko_ffi_name} = other.gecko.mAnimations[index].m${gecko_ffi_name};
}
}
Expand Down Expand Up @@ -1388,8 +1393,13 @@ fn static_assert() {
}
pub fn copy_animation_name_from(&mut self, other: &Self) {
unsafe { self.gecko.mAnimations.ensure_len(other.gecko.mAnimations.len()) };
self.gecko.mAnimationNameCount = other.gecko.mAnimationNameCount;
for (index, animation) in self.gecko.mAnimations.iter_mut().enumerate() {

let count = other.gecko.mAnimationNameCount;
self.gecko.mAnimationNameCount = count;

// The length of mAnimations is often greater than mAnimationXXCount,
// don't copy values over the count.
for (index, animation) in self.gecko.mAnimations.iter_mut().enumerate().take(count as usize) {
animation.mName.assign(&other.gecko.mAnimations[index].mName);
}
}
Expand Down

0 comments on commit f960b4c

Please sign in to comment.