Bug 1452542 part 3 - Use snake_case naming for nsCSSPropertyID of alias as well. r=emilio
☠☠ backed out by 43b3f5fba6d7 ☠ ☠
authorXidorn Quan <me@upsuper.org>
Wed, 11 Apr 2018 13:44:30 +1000
changeset 467830 e83a797bdc61a880497a485e378d3b16c5bad258
parent 467829 255e2feff19f8f6fc8bedd950c6cee93307748d3
child 467831 5619bba37cddc6f002dc0a719a6e935618243594
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1452542
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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