Bug 1358966 - nscsspropertyid_is_animatable handles shorthand property as well. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 08 Jun 2017 12:38:46 +0900
changeset 590791 29773ee756fe4f4d27d5fb40c8e15246edd70e32
parent 590790 3a79678e4e9e30fbad4b550d2075b9f02f7e48df
child 590792 f5719cf4f204492e2a6c0248e5b88bae7998052d
push id62829
push userhikezoe@mozilla.com
push dateThu, 08 Jun 2017 03:39:35 +0000
reviewersbirtles
bugs1358966
milestone55.0a1
Bug 1358966 - nscsspropertyid_is_animatable handles shorthand property as well. r?birtles We consider the shorthand animatable if any of sub properties are animatable. MozReview-Commit-ID: HdVzr6u1p9Z
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
@@ -191,16 +191,26 @@ impl TransitionProperty {
 #[cfg(feature = "gecko")]
 pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
     match property {
         % for prop in data.longhands:
             % if prop.animatable:
                 ${helpers.to_nscsspropertyid(prop.ident)} => true,
             % endif
         % endfor
+        % for prop in data.shorthands_except_all():
+            <%
+                animatable = "false"
+                for sub in prop.sub_properties:
+                    if sub.animatable:
+                        animatable = "true"
+                        break
+            %>
+            ${helpers.to_nscsspropertyid(prop.ident)} => ${animatable},
+        % endfor
         _ => false
     }
 }
 
 impl ToCss for TransitionProperty {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
         where W: fmt::Write,
     {