Bug 1378076 - Part 6: make -moz-appearance property animatable. r?hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 11 Jul 2017 21:30:19 +0900
changeset 606809 deae81e2610c59baf1231514eb6c184affd94621
parent 606808 7b4391fb976b1c2c7a4d2ec9e66195895b9b11d0
child 606810 93dd471b82dcc24444b2f44f62d5ecea4e00c7ed
push id67808
push userbmo:dakatsuka@mozilla.com
push dateTue, 11 Jul 2017 13:13:53 +0000
reviewershiro
bugs1378076
milestone56.0a1
Bug 1378076 - Part 6: make -moz-appearance property animatable. r?hiro In this patch, make following properties animatable. * -moz-appearance To realize this, we address for non_upper_case_globals rule of Rust since the prefix of Gecko filed is ThemeWidgetType_NS_THEME. Actually, we can think two ways to fix. 1. Add #[arrow(non_upper_case_globals)] attribute. 2. Force to change to upper case. In this time, we use 2 since don't want to use such the attribute for the coding style consistency even generated code. MozReview-Commit-ID: 1zauxWzomLt
servo/components/style/properties/data.py
servo/components/style/properties/longhand/box.mako.rs
--- a/servo/components/style/properties/data.py
+++ b/servo/components/style/properties/data.py
@@ -128,17 +128,17 @@ class Keyword(object):
     def maybe_cast(self, type_str):
         return "as " + type_str if self.needs_cast() else ""
 
     def casted_constant_name(self, value, cast_type):
         if cast_type is None:
             raise TypeError("We should specify the cast_type.")
 
         if self.gecko_enum_prefix is None:
-            return cast_type.upper() + "_" + self.gecko_constant(value)
+            return cast_type.upper() + "_" + self.gecko_constant(value).upper()
         else:
             return cast_type.upper() + "_" + self.gecko_constant(value).upper().replace("::", "_")
 
 
 def arg_to_bool(arg):
     if isinstance(arg, bool):
         return arg
     assert arg in ["True", "False"]
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -1848,17 +1848,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)",
                           disable_when_testing="True")}