Bug 1371518 - Move nscssproperty_id_is_animatable together with the other animatable-related code; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Wed, 14 Jun 2017 15:03:18 +0900
changeset 593858 a23a9f3e1bb42bbef5ac8d8a86b6ab180be5337b
parent 593857 273a82324c9aa35eb3efa84bc6ae53c7fb330a84
child 593859 b396ae331c0974aa6c4169e2581dd10054b9eb5e
push id63840
push userbbirtles@mozilla.com
push dateWed, 14 Jun 2017 07:29:38 +0000
reviewershiro
bugs1371518
milestone56.0a1
Bug 1371518 - Move nscssproperty_id_is_animatable together with the other animatable-related code; r?hiro Now we have AnimatableLonghand (to do with animatability) and TransitionProperty (to do with transitionability), we should move nscssproperty_id_is_animatable to be part of the former group. MozReview-Commit-ID: 7R6Zzi7RrMb
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
@@ -158,16 +158,29 @@ impl<'a> From<AnimatableLonghand> for Pr
                     AnimatableLonghand::${prop.camel_case}
                         => PropertyDeclarationId::Longhand(LonghandId::${prop.camel_case}),
                 % endif
             % endfor
         }
     }
 }
 
+/// Returns true if this nsCSSPropertyID is one of the animatable properties.
+#[cfg(feature = "gecko")]
+pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
+    match property {
+        % for prop in data.longhands + data.shorthands_except_all():
+            % if prop.animatable:
+                ${helpers.to_nscsspropertyid(prop.ident)} => true,
+            % endif
+        % endfor
+        _ => false
+    }
+}
+
 /// A given transition property, that is either `All`, a transitionable longhand property,
 /// a shorthand with at least one transitionable longhand component, or an unsupported property.
 // NB: This needs to be here because it needs all the longhands generated
 // beforehand.
 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum TransitionProperty {
     /// All, any transitionable property changing should generate a transition.
@@ -261,29 +274,16 @@ impl TransitionProperty {
                     TransitionProperty::${prop.camel_case} => true,
                 % endif
             % endfor
             _ => false
         }
     }
 }
 
-/// Returns true if this nsCSSPropertyID is one of the animatable properties.
-#[cfg(feature = "gecko")]
-pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
-    match property {
-        % for prop in data.longhands + data.shorthands_except_all():
-            % if prop.animatable:
-                ${helpers.to_nscsspropertyid(prop.ident)} => true,
-            % endif
-        % endfor
-        _ => false
-    }
-}
-
 impl ToCss for TransitionProperty {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
         where W: fmt::Write,
     {
         match *self {
             TransitionProperty::All => dest.write_str("all"),
             % for prop in data.longhands + data.shorthands_except_all():
                 % if prop.transitionable: