Bug 1311257 - Make TransitionProperty::from_declaration() convert PropertyDeclaration::{CSSWideKeyword,WithVariables} as well. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 05 Apr 2017 08:34:37 +0900
changeset 555840 308b4f1425ed9cb1bbcd1accafcc2bd18e4b7bfb
parent 554958 aaa0cd3bd620daf6be29c72625f6e63fd0bc1d46
child 555841 0d3d94b4241cc8427275b5d64d51d6e73be8051f
push id52367
push userhikezoe@mozilla.com
push dateWed, 05 Apr 2017 02:18:23 +0000
reviewersheycam
bugs1311257
milestone55.0a1
Bug 1311257 - Make TransitionProperty::from_declaration() convert PropertyDeclaration::{CSSWideKeyword,WithVariables} as well. r?heycam MozReview-Commit-ID: G5pk50Rh4Ls
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
@@ -83,16 +83,28 @@ impl TransitionProperty {
     pub fn from_declaration(declaration: &PropertyDeclaration) -> Option<Self> {
         match *declaration {
             % for prop in data.longhands:
                 % if prop.animatable:
                     PropertyDeclaration::${prop.camel_case}(..)
                         => Some(TransitionProperty::${prop.camel_case}),
                 % endif
             % endfor
+            PropertyDeclaration::CSSWideKeyword(id, _) |
+            PropertyDeclaration::WithVariables(id, _) => {
+                match id {
+                    % for prop in data.longhands:
+                        % if prop.animatable:
+                            LonghandId::${prop.camel_case} =>
+                                Some(TransitionProperty::${prop.camel_case}),
+                        % endif
+                    % endfor
+                    _ => None,
+                }
+            },
             _ => None,
         }
     }
 }
 
 impl ToCss for TransitionProperty {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
         where W: fmt::Write,