Bug 1381386 - Implement ToCss for SpecifiedOperation::{InterpolateMatrix|AccumulateMatrix}. draft
authorBoris Chiou <boris.chiou@gmail.com>
Fri, 28 Jul 2017 10:58:08 +0800
changeset 617187 3a6c63613c5933da92274b6e4b883e49a4509f33
parent 616615 c5b663c970171cb862d40e81d2c7f378a558694a
child 639740 4a4e1fe694b662a8bfa534f97c0bd85a8bc797b0
push id70973
push userbmo:boris.chiou@gmail.com
push dateFri, 28 Jul 2017 03:51:53 +0000
bugs1381386
milestone56.0a1
Bug 1381386 - Implement ToCss for SpecifiedOperation::{InterpolateMatrix|AccumulateMatrix}. DevTools may serialize an InterpolateMatrix or AccumulateMatrix by KeyframeEffectReadOnly::GetProperties(), so we have to implement both. MozReview-Commit-ID: 5ZvC3g9OKH3
servo/components/style/properties/longhand/box.mako.rs
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -974,17 +974,24 @@
                 SpecifiedOperation::Rotate(theta) => write!(dest, "rotate({})", Css(theta)),
                 SpecifiedOperation::RotateX(theta) => write!(dest, "rotateX({})", Css(theta)),
                 SpecifiedOperation::RotateY(theta) => write!(dest, "rotateY({})", Css(theta)),
                 SpecifiedOperation::RotateZ(theta) => write!(dest, "rotateZ({})", Css(theta)),
                 SpecifiedOperation::Rotate3D(x, y, z, theta) => write!(
                     dest, "rotate3d({}, {}, {}, {})",
                     Css(x), Css(y), Css(z), Css(theta)),
                 SpecifiedOperation::Perspective(ref length) => write!(dest, "perspective({})", Css(length)),
-                _ => unreachable!(),
+                SpecifiedOperation::InterpolateMatrix { ref from_list, ref to_list, progress } => {
+                    write!(dest, "interpolatematrix({}, {}, {})",
+                           Css(from_list), Css(to_list), Css(progress))
+                },
+                SpecifiedOperation::AccumulateMatrix { ref from_list, ref to_list, count } => {
+                    write!(dest, "accumulatematrix({}, {}, {})",
+                           Css(from_list), Css(to_list), Css(count))
+                }
             }
         }
     }
 
     #[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue(Vec<SpecifiedOperation>);