Add an FFI function that returns an AnimationValue for a given nsCSSPropertyID from computed values.

When we compose style for a given nsCSSPropertyID in the case where
we have no specified values in target keyframe, we use this AnimationValue
for composition as if it's specified.
This commit is contained in:
Hiroyuki Ikezoe 2017-04-06 10:29:58 +09:00
parent fb6aceba31
commit 97aacb242e
2 changed files with 26 additions and 0 deletions

View file

@ -340,6 +340,15 @@ pub extern "C" fn Servo_StyleSet_GetBaseComputedValuesForElement(raw_data: RawSe
.into_strong()
}
#[no_mangle]
pub extern "C" fn Servo_ComputedValues_ExtractAnimationValue(computed_values: ServoComputedValuesBorrowed,
property_id: nsCSSPropertyID)
-> RawServoAnimationValueStrong
{
let computed_values = ComputedValues::as_arc(&computed_values);
Arc::new(AnimationValue::from_computed_values(&property_id.into(), computed_values)).into_strong()
}
#[no_mangle]
pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
GLOBAL_STYLE_DATA.num_threads as u32