Bug 1376495 - Part 4: Make shape-outside animatable. draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Thu, 10 Aug 2017 17:15:44 +0900
changeset 643920 2360578ca13258a4d18bbc0975b72d6425d5b73d
parent 643919 3c037c948d160f22572fbb11f3ee4faf609b0fec
child 643921 e339efbb8b363b13402aea89d3e8ba0363670155
push id73256
push userbmo:dakatsuka@mozilla.com
push dateThu, 10 Aug 2017 08:16:22 +0000
bugs1376495
milestone57.0a1
Bug 1376495 - Part 4: Make shape-outside animatable. MozReview-Commit-ID: 14gCUkvp3f8
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
@@ -1900,23 +1900,31 @@
                     "all",
                     "auto",
                 ])
             }).map(SpecifiedValue::AnimateableFeatures)
         }
     }
 </%helpers:longhand>
 
+<% initial_clip_path_value = "::values::generics::basic_shape::ShapeSource::None" %>
 ${helpers.predefined_type("shape-outside", "basic_shape::FloatAreaShape",
-                          "generics::basic_shape::ShapeSource::None",
+                          initial_clip_path_value,
                           products="gecko", boxed="True",
-                          animation_value_type="none",
+                          animation_value_type="ComputedValue",
                           flags="APPLIES_TO_FIRST_LETTER",
                           spec="https://drafts.csswg.org/css-shapes/#shape-outside-property")}
 
+use values::computed::basic_shape::FloatAreaShape;
+impl values::animated::ToAnimatedZero for FloatAreaShape {
+    fn to_animated_zero(&self) -> Result<Self, ()> {
+        Ok(${initial_clip_path_value})
+    }
+}
+
 <%helpers:longhand name="touch-action"
                    products="gecko"
                    animation_value_type="discrete"
                    disable_when_testing="True"
                    spec="https://compat.spec.whatwg.org/#touch-action">
     use gecko_bindings::structs;
     use std::fmt;
     use style_traits::ToCss;