Bug 1383493 - MatrixDecomposed3D.add_weighted() is called with zero value for other_portion in case of iteration composite. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 25 Jul 2017 16:13:16 +0900
changeset 615478 3ef2e8456a17936a4d1af6708767e8c266a48236
parent 615352 c6d36106525ba7b65a3587d643c3b145de80fb99
child 615479 d1e3d59061a5257e889fe80c144239525a8129f9
push id70376
push userhikezoe@mozilla.com
push dateWed, 26 Jul 2017 02:13:29 +0000
reviewersbirtles
bugs1383493
milestone56.0a1
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
servo/components/style/properties/helpers/animated_properties.mako.rs
--- 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)?;