Bug 1452542 part 3 - Use snake_case naming for nsCSSPropertyID of alias as well. r?emilio
MozReview-Commit-ID: 242ms8wBDIU
--- 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