Bug 1448759 part 4 - Switch gAllSubpropTable to use generated ServoCSSPropList.h. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Sun, 29 Apr 2018 22:03:48 +1000
changeset 789582 69dc53de7d5a6863eed453f5a133bedec7a59a98
parent 789581 960915d6012b822f13c4cce8e71402b6c50c4773
child 789583 a2f31605181857f20a6ce9d22439a590b0c17626
push id108289
push userxquan@mozilla.com
push dateSun, 29 Apr 2018 23:15:53 +0000
reviewersheycam
bugs1448759
milestone61.0a1
Bug 1448759 part 4 - Switch gAllSubpropTable to use generated ServoCSSPropList.h. r?heycam MozReview-Commit-ID: IfzfFpw5ABz
layout/style/GenerateServoCSSPropList.py
layout/style/nsCSSProps.cpp
--- a/layout/style/GenerateServoCSSPropList.py
+++ b/layout/style/GenerateServoCSSPropList.py
@@ -79,21 +79,26 @@ def generate_header(output, data):
             elif method.startswith("Moz"):
                 method = "CSS_PROP_DOMPROP_PREFIXED({})".format(method[3:])
             if flags:
                 flags = " | ".join(flags)
             else:
                 flags = "CSSPropFlags(0)"
             params = [name, id, method, flags, pref]
 
+        is_component_of_all = not is_internal and name not in ["direction", "unicode-bidi"]
+        if not is_component_of_all:
+            output.write("#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND\n")
         if is_internal:
             output.write("#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL\n")
         output.write("{}({})\n".format(MACRO_NAMES[proptype], ", ".join(params)))
         if is_internal:
             output.write("#endif\n")
+        if not is_component_of_all:
+            output.write("#endif\n")
 
     output.write("""
 #ifdef DEFINED_CSS_PROP_ALIAS
 #undef CSS_PROP_ALIAS
 #undef DEFINED_CSS_PROP_ALIAS
 #endif
 
 #ifdef DEFINED_CSS_PROP_SHORTHAND
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2199,19 +2199,19 @@ const CSSPropFlags nsCSSProps::kFlagsTab
 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, ...) flags_,
 #include "mozilla/ServoCSSPropList.h"
 #undef CSS_PROP_SHORTHAND
 #undef CSS_PROP_LONGHAND
 };
 
 static const nsCSSPropertyID gAllSubpropTable[] = {
 #define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
-#define CSS_PROP(name_, id_, ...) eCSSProperty_##id_,
-#include "nsCSSPropList.h"
-#undef CSS_PROP
+#define CSS_PROP_LONGHAND(name_, id_, ...) eCSSProperty_##id_,
+#include "mozilla/ServoCSSPropList.h"
+#undef CSS_PROP_LONGHAND
 #undef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
   eCSSProperty_UNKNOWN
 };
 
 static const nsCSSPropertyID gAnimationSubpropTable[] = {
   eCSSProperty_animation_duration,
   eCSSProperty_animation_timing_function,
   eCSSProperty_animation_delay,