From 5c5a72c1d81eef9889a5355cd9c87207313d1316 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Wed, 30 Aug 2017 12:03:25 +0800 Subject: [PATCH] Return Err(()) if determinant is not 1 or -1 while decomposing the 2d matrix. This may happen in some cases, and we shouldn't panic in debug mode, so let's return Err(()) for it to fall back to discrete animation. --- .../style/properties/helpers/animated_properties.mako.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 4c2057f61d9..5cdcb52851c 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -1692,8 +1692,8 @@ fn decompose_2d_matrix(matrix: &ComputedMatrix) -> Result Result determinant.abs() || determinant.abs() > 1.01 { + return Err(()); + } if determinant < 0. { m11 = -m11;