Bug 1354947 - Rename add_computed_property_value to append_computed_property_value. r?birtles
We don't need to pass index to the function any more.
MozReview-Commit-ID: GQ6hFH68N35
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -2080,23 +2080,23 @@ pub extern "C" fn Servo_AssertTreeIsClea
assert_subtree_is_clean(child);
}
}
}
assert_subtree_is_clean(root);
}
-fn add_computed_property_value(keyframe: *mut structs::Keyframe,
- index: usize,
- style: &ComputedValues,
- property: &TransitionProperty,
- shared_lock: &SharedRwLock) {
+fn append_computed_property_value(keyframe: *mut structs::Keyframe,
+ style: &ComputedValues,
+ property: &TransitionProperty,
+ shared_lock: &SharedRwLock) {
let block = style.to_declaration_block(property.clone().into());
unsafe {
+ let index = (*keyframe).mPropertyValues.len();
(*keyframe).mPropertyValues.set_len((index + 1) as u32);
(*keyframe).mPropertyValues[index].mProperty = property.into();
// FIXME. Bug 1360398: Do not set computed values once we handles
// missing keyframes with additive composition.
(*keyframe).mPropertyValues[index].mServoDeclarationBlock.set_arc_leaky(
Arc::new(shared_lock.wrap(block)));
}
}
@@ -2126,25 +2126,22 @@ fn fill_in_missing_keyframe_values(all_p
},
1. => unsafe {
Gecko_GetOrCreateFinalKeyframe(keyframes, timing_function)
},
_ => unreachable!("offset should be 0. or 1."),
};
// Append properties that have not been set at this offset.
- let mut index = unsafe { (*keyframe).mPropertyValues.len() };
for ref property in all_properties.iter() {
if !properties_set_at_offset.has_transition_property_bit(property) {
- add_computed_property_value(keyframe,
- index,
- style,
- property,
- shared_lock);
- index += 1;
+ append_computed_property_value(keyframe,
+ style,
+ property,
+ shared_lock);
}
}
}
#[no_mangle]
pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetBorrowed,
name: *const nsACString,
inherited_timing_function: nsTimingFunctionBorrowed,
@@ -2197,19 +2194,21 @@ pub extern "C" fn Servo_StyleSet_GetKeyf
match step.value {
KeyframesStepValue::ComputedValues => {
// In KeyframesAnimation::from_keyframes if there is no 0% or
// 100% keyframe at all, we will create a 'ComputedValues' step
// to represent that all properties animated by the keyframes
// animation should be set to the underlying computed value for
// that keyframe.
- for (index, property) in animation.properties_changed.iter().enumerate() {
- add_computed_property_value(
- keyframe, index, style, property, &global_style_data.shared_lock);
+ for property in animation.properties_changed.iter() {
+ append_computed_property_value(keyframe,
+ style,
+ property,
+ &global_style_data.shared_lock);
}
if current_offset == 0.0 {
has_complete_initial_keyframe = true;
} else if current_offset == 1.0 {
has_complete_final_keyframe = true;
}
},
KeyframesStepValue::Declarations { ref block } => {