Bug 1376495 - Part 3: Make clip-path animatable. draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Thu, 10 Aug 2017 17:15:43 +0900
changeset 643919 3c037c948d160f22572fbb11f3ee4faf609b0fec
parent 643918 657dda8ff2c674e1266c5c0caeafd05346b3fb9d
child 643920 2360578ca13258a4d18bbc0975b72d6425d5b73d
push id73256
push userbmo:dakatsuka@mozilla.com
push dateThu, 10 Aug 2017 08:16:22 +0000
bugs1376495
milestone57.0a1
Bug 1376495 - Part 3: Make clip-path animatable. MozReview-Commit-ID: yxTh9Q9B82
servo/components/style/properties/longhand/svg.mako.rs
--- a/servo/components/style/properties/longhand/svg.mako.rs
+++ b/servo/components/style/properties/longhand/svg.mako.rs
@@ -52,22 +52,31 @@
     spec="https://www.w3.org/TR/SVG/filters.html#LightingColorProperty")}
 
 // CSS Masking Module Level 1
 // https://drafts.fxtf.org/css-masking
 ${helpers.single_keyword("mask-type", "luminance alpha",
                          products="gecko", animation_value_type="discrete",
                          spec="https://drafts.fxtf.org/css-masking/#propdef-mask-type")}
 
+<% initial_clip_path_value = "::values::generics::basic_shape::ShapeSource::None" %>
 ${helpers.predefined_type("clip-path", "basic_shape::ClippingShape",
-                          "generics::basic_shape::ShapeSource::None",
+                          initial_clip_path_value,
                           products="gecko", boxed="True",
-                          animation_value_type="none", flags="CREATES_STACKING_CONTEXT",
+                          animation_value_type="ComputedValue",
+                          flags="CREATES_STACKING_CONTEXT",
                           spec="https://drafts.fxtf.org/css-masking/#propdef-clip-path")}
 
+use values::computed::basic_shape::ClippingShape;
+impl ::values::animated::ToAnimatedZero for ClippingShape {
+    fn to_animated_zero(&self) -> Result<Self, ()> {
+        Ok(${initial_clip_path_value})
+    }
+}
+
 ${helpers.single_keyword("mask-mode",
                          "match-source alpha luminance",
                          vector=True,
                          products="gecko",
                          animation_value_type="discrete",
                          spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode")}
 
 <%helpers:vector_longhand name="mask-repeat" products="gecko" animation_value_type="discrete" extra_prefixes="webkit"