aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-02 06:03:40 -0500
committerGitHub <noreply@github.com>2017-05-02 06:03:40 -0500
commitf779661392af86050b4c28c759d260beb07b9249 (patch)
tree46be29c6fd29a7ae7c1d41f80afe58237abf4cce
parent997a3e8374092bc4bc90455c7b51b74b30a1e167 (diff)
parent7ef036d120d497b35f9ec86e7483f5915099345b (diff)
downloadservo-f779661392af86050b4c28c759d260beb07b9249.tar.gz
servo-f779661392af86050b4c28c759d260beb07b9249.zip
Auto merge of #16690 - hiikezoe:multiple-properties-in-keyframe, r=birtles
Set multiple properties in a keyframe correctly. This is a PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1359669 - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because it's for stylo. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16690) <!-- Reviewable:end -->
-rw-r--r--ports/geckolib/glue.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index a7c3de942bf..25790188460 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -2019,6 +2019,7 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
// mServoDeclarationBlock is null in the case where we have an invalid css property.
let iter = keyframe.mPropertyValues.iter()
.filter(|&property| !property.mServoDeclarationBlock.mRawPtr.is_null());
+ let mut property_index = 0;
for property in iter {
let declarations = unsafe { &*property.mServoDeclarationBlock.mRawPtr.clone() };
let declarations = Locked::<PropertyDeclarationBlock>::as_arc(&declarations);
@@ -2045,17 +2046,18 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis
}
});
- for (i, anim) in anim_iter.enumerate() {
+ for anim in anim_iter {
if !seen.has_transition_property_bit(&anim.0) {
// This is safe since we immediately write to the uninitialized values.
- unsafe { animation_values.set_len((i + 1) as u32) };
+ unsafe { animation_values.set_len((property_index + 1) as u32) };
seen.set_transition_property_bit(&anim.0);
- animation_values[i].mProperty = (&anim.0).into();
+ animation_values[property_index].mProperty = (&anim.0).into();
// We only make sure we have enough space for this variable,
// but didn't construct a default value for StyleAnimationValue,
// so we should zero it to avoid getting undefined behaviors.
- animation_values[i].mValue.mGecko = unsafe { mem::zeroed() };
- animation_values[i].mValue.mServo.set_arc_leaky(Arc::new(anim.1));
+ animation_values[property_index].mValue.mGecko = unsafe { mem::zeroed() };
+ animation_values[property_index].mValue.mServo.set_arc_leaky(Arc::new(anim.1));
+ property_index += 1;
}
}
}