aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ports/geckolib/glue.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index eca3ba79d68..684a1992c8b 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -386,7 +386,9 @@ pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationV
-> f64 {
let from_value = AnimationValue::as_arc(&from);
let to_value = AnimationValue::as_arc(&to);
- from_value.compute_squared_distance(to_value).map(|d| d.sqrt()).unwrap_or(0.0)
+ // If compute_squared_distance() failed, this function will return negative value
+ // in order to check whether we support the specified paced animation values.
+ from_value.compute_squared_distance(to_value).map(|d| d.sqrt()).unwrap_or(-1.0)
}
#[no_mangle]