diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index e0c8de4ac40..6c118e92bdc 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -1692,6 +1692,13 @@ extern "C" { progress: f64) -> RawServoAnimationValueStrong; } +extern "C" { + pub fn Servo_AnimationValues_IsInterpolable(from: + RawServoAnimationValueBorrowed, + to: + RawServoAnimationValueBorrowed) + -> bool; +} extern "C" { pub fn Servo_AnimationValue_Serialize(value: RawServoAnimationValueBorrowed, diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index c78be1a196c..bb7267cd175 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -256,6 +256,15 @@ pub extern "C" fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValue } } +#[no_mangle] +pub extern "C" fn Servo_AnimationValues_IsInterpolable(from: RawServoAnimationValueBorrowed, + to: RawServoAnimationValueBorrowed) + -> bool { + let from_value = AnimationValue::as_arc(&from); + let to_value = AnimationValue::as_arc(&to); + from_value.interpolate(to_value, 0.5).is_ok() +} + #[no_mangle] pub extern "C" fn Servo_AnimationValueMap_Push(value_map: RawServoAnimationValueMapBorrowed, property: nsCSSPropertyID,