Bug 1382138 - Part 1: Make -moz-appearance animatable. r?hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Mon, 14 Aug 2017 01:34:50 +0900
changeset 645628 e1b228b19914f9e02882c416711b06562c41ad15
parent 645499 59594b3879cc7b038ba8a1ed6e9e66c6423bf6e2
child 645629 159ff9e95a7e8947d82201372f3aaaf34235970b
push id73802
push userbmo:dakatsuka@mozilla.com
push dateSun, 13 Aug 2017 16:35:16 +0000
reviewershiro
bugs1382138
milestone57.0a1
Bug 1382138 - Part 1: Make -moz-appearance animatable. r?hiro MozReview-Commit-ID: DDT9IWcevZB
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhand/box.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -464,17 +464,20 @@ def set_gecko_property(ffi_name, expr):
         ${set_gecko_property(gecko_ffi_name, "result")}
         % if on_set:
         self.${on_set}();
         % endif
     }
 </%def>
 
 <%def name="impl_keyword_clone(ident, gecko_ffi_name, keyword, cast_type='u8')">
-    #[allow(non_snake_case)]
+    // FIXME: We introduced non_upper_case_globals for -moz-appearance only
+    //        since the prefix of Gecko value starts with ThemeWidgetType_NS_THEME.
+    //        We should remove this after fix bug 1371809.
+    #[allow(non_snake_case, non_upper_case_globals)]
     pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
         use properties::longhands::${ident}::computed_value::T as Keyword;
         // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts
 
         // Some constant macros in the gecko are defined as negative integer(e.g. font-stretch).
         // And they are convert to signed integer in Rust bindings. We need to cast then
         // as signed type when we have both signed/unsigned integer in order to use them
         // as match's arms.
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -1818,17 +1818,17 @@
                             -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore
                             -moz-window-frame-bottom -moz-window-frame-left -moz-window-frame-right -moz-window-titlebar
                             -moz-window-titlebar-maximized
                          """,
                          gecko_ffi_name="mAppearance",
                          gecko_constant_prefix="ThemeWidgetType_NS_THEME",
                          products="gecko",
                          spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
-                         animation_value_type="none")}
+                         animation_value_type="discrete")}
 
 ${helpers.predefined_type("-moz-binding", "UrlOrNone", "Either::Second(None_)",
                           products="gecko",
                           boxed="True" if product == "gecko" else "False",
                           animation_value_type="none",
                           gecko_ffi_name="mBinding",
                           spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-binding)")}