Bug 1383493 - MatrixDecomposed3D.add_weighted() is called with zero value for other_portion in case of iteration composite. r?birtles
In the case where we accumulate transform:none onto decomposed matrix for
iteration composite whose iteration count is over 2, we pass zero
other_portion and self_portion which is over 1.0. We should care about the
case.
MozReview-Commit-ID: 2qxx9WMVyg3
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -2269,17 +2269,17 @@ impl Animatable for Perspective {
impl Animatable for MatrixDecomposed3D {
/// https://drafts.csswg.org/css-transforms/#interpolation-of-decomposed-3d-matrix-values
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64)
-> Result<Self, ()> {
use std::f64;
debug_assert!((self_portion + other_portion - 1.0f64).abs() <= f64::EPSILON ||
- other_portion == 1.0f64,
+ other_portion == 1.0f64 || other_portion == 0.0f64,
"add_weighted should only be used for interpolating or accumulating transforms");
let mut sum = *self;
// Add translate, scale, skew and perspective components.
sum.translate = self.translate.add_weighted(&other.translate, self_portion, other_portion)?;
sum.scale = self.scale.add_weighted(&other.scale, self_portion, other_portion)?;
sum.skew = self.skew.add_weighted(&other.skew, self_portion, other_portion)?;