Bug 1452542 part 3 - Use snake_case naming for nsCSSPropertyID of alias as well. r?emilio draft
authorXidorn Quan <me@upsuper.org>
Wed, 11 Apr 2018 13:44:30 +1000
changeset 784816 d3cfadefa8481f8dd77e488a56dbd92e8d874bc9
parent 784815 3b2513353b99417bca7775284c879c0d6a08ac4b
child 784817 7096484030affcc66793b5eefa055fa002a8ce6b
child 784860 9267dbef13e9e9c792292af7fef8811a5817f1d4
push id107043
push userxquan@mozilla.com
push dateThu, 19 Apr 2018 05:20:45 +0000
reviewersemilio
bugs1452542
milestone61.0a1
Bug 1452542 part 3 - Use snake_case naming for nsCSSPropertyID of alias as well. r?emilio MozReview-Commit-ID: 242ms8wBDIU
layout/style/GenerateCSSPropsGenerated.py
layout/style/PythonCSSProps.h
layout/style/nsCSSPropertyID.h
layout/style/nsCSSProps.cpp
servo/components/style/properties/data.py
--- a/layout/style/GenerateCSSPropsGenerated.py
+++ b/layout/style/GenerateCSSPropsGenerated.py
@@ -52,17 +52,17 @@ def generate_idl_names(properties):
             names.append("  nullptr,  // %s" % p["name"])
         else:
             names.append('  "%s",' % p["idlname"])
     return "\n".join(names)
 
 def generate_assertions(properties):
     def enum(p):
         if p["proptype"] is "alias":
-            return "eCSSPropertyAlias_%s" % p["prop"]
+            return "eCSSPropertyAlias_%s" % p["id"]
         else:
             return "eCSSProperty_%s" % p["id"]
     msg = ('static_assert(%s == %d, "GenerateCSSPropsGenerated.py did not list '
            'properties in nsCSSPropertyID order");')
     return "\n".join(map(lambda p: msg % (enum(p), p["index"]), properties))
 
 def generate_idl_name_positions(properties):
     # Skip aliases.
--- a/layout/style/PythonCSSProps.h
+++ b/layout/style/PythonCSSProps.h
@@ -23,18 +23,18 @@
 #define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) publicname_
 
 #include "nsCSSPropList.h"
 
 #undef CSS_PROP_PUBLIC_OR_PRIVATE
 #undef CSS_PROP_SHORTHAND
 #undef CSS_PROP
 
-#define CSS_PROP_ALIAS(name, aliasid_, id, method, pref) \
-  DO_PROP(name, method, id, 0, pref, "alias")
+#define CSS_PROP_ALIAS(name, aliasid, id, method, pref) \
+  DO_PROP(name, method, aliasid, 0, pref, "alias")
 
 #include "nsCSSPropAliasList.h"
 
 #undef CSS_PROP_ALIAS
 
 #undef DO_PROP
 #undef PROP_STRINGIFY
 #undef PROP_STRINGIFY_INTERNAL
--- a/layout/style/nsCSSPropertyID.h
+++ b/layout/style/nsCSSPropertyID.h
@@ -33,17 +33,17 @@ enum nsCSSPropertyID {
   #include "nsCSSPropList.h"
   #undef CSS_PROP_SHORTHAND
 
   eCSSProperty_COUNT,
   // Make the count continue where it left off:
   eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1,
 
   #define CSS_PROP_ALIAS(aliasname_, aliasid_, id_, method_, pref_) \
-    eCSSPropertyAlias_##method_,
+    eCSSPropertyAlias_##aliasid_,
   #include "nsCSSPropAliasList.h"
   #undef CSS_PROP_ALIAS
 
   eCSSProperty_COUNT_with_aliases,
   // Make the count continue where it left off:
   eCSSProperty_COUNT_DUMMY3 = eCSSProperty_COUNT_with_aliases - 1,
 
   // Some of the values below could probably overlap with each other
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -187,17 +187,17 @@ nsCSSProps::AddRefTable(void)
       #undef CSS_PROP
 
       #define  CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
         OBSERVE_PROP(pref_, eCSSProperty_##id_)
       #include "nsCSSPropList.h"
       #undef CSS_PROP_SHORTHAND
 
       #define CSS_PROP_ALIAS(aliasname_, aliasid_, propid_, aliasmethod_, pref_)    \
-        OBSERVE_PROP(pref_, eCSSPropertyAlias_##aliasmethod_)
+        OBSERVE_PROP(pref_, eCSSPropertyAlias_##aliasid_)
       #include "nsCSSPropAliasList.h"
       #undef CSS_PROP_ALIAS
 
       #undef OBSERVE_PROP
     }
 
 #ifdef DEBUG
     {
--- a/servo/components/style/properties/data.py
+++ b/servo/components/style/properties/data.py
@@ -401,17 +401,17 @@ class Alias(object):
 
     def explicitly_enabled_in_chrome(self):
         return self.enabled_in == "chrome"
 
     def enabled_in_content(self):
         return self.enabled_in == "content"
 
     def nscsspropertyid(self):
-        return "nsCSSPropertyID::eCSSPropertyAlias_%s" % self.camel_case
+        return "nsCSSPropertyID::eCSSPropertyAlias_%s" % self.ident
 
 
 class Method(object):
     def __init__(self, name, return_type=None, arg_types=None, is_mut=False):
         self.name = name
         self.return_type = return_type
         self.arg_types = arg_types or []
         self.is_mut = is_mut