diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index b16d0a442b3..034992d1b21 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -1301,6 +1301,11 @@ extern "C" { RawServoAnimationValueBorrowedListBorrowed) -> RawServoDeclarationBlockStrong; } +extern "C" { + pub fn Servo_AnimationValues_GetOpacity(value: + RawServoAnimationValueBorrowed) + -> f32; +} extern "C" { pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal) -> RawServoDeclarationBlockStrong; diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index d53c72d3e8c..bee77e36b9f 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -205,6 +205,18 @@ pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueB })).into_strong() } +#[no_mangle] +pub extern "C" fn Servo_AnimationValues_GetOpacity(value: RawServoAnimationValueBorrowed) + -> f32 +{ + let value = AnimationValue::as_arc(&value); + if let AnimationValue::Opacity(opacity) = **value { + opacity + } else { + panic!("The AnimationValue should be Opacity"); + } +} + /// Takes a ServoAnimationValues and populates it with the animation values corresponding /// to a given property declaration block #[no_mangle]