Bug 1420383 - Move nsCSSProps::kParserVariantTable into its rightful home in nsCSSProps.cpp. r?xidorn draft
authorCameron McCormack <cam@mcc.id.au>
Fri, 24 Nov 2017 18:17:36 +0800
changeset 703144 edc2d7a690550aeeb03115e78c8a119c50baada1
parent 703108 21cfc269124824855f95704e6d8817452696f595
child 741675 382db96deba8117eafed1e2a6ae1944cb6d3ee56
push id90716
push userbmo:cam@mcc.id.au
push dateFri, 24 Nov 2017 10:18:14 +0000
reviewersxidorn
bugs1420383
milestone59.0a1
Bug 1420383 - Move nsCSSProps::kParserVariantTable into its rightful home in nsCSSProps.cpp. r?xidorn MozReview-Commit-ID: 7Rg3EYq5GPQ
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -66,27 +66,16 @@
 #include "mozilla/dom/URL.h"
 #include "gfxFontFamilyList.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
 
 typedef nsCSSProps::KTableEntry KTableEntry;
 
-const uint32_t
-nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = {
-#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
-                 stylestruct_, stylestructoffset_, animtype_)                 \
-  parsevariant_,
-#define CSS_PROP_LIST_INCLUDE_LOGICAL
-#include "nsCSSPropList.h"
-#undef CSS_PROP_LIST_INCLUDE_LOGICAL
-#undef CSS_PROP
-};
-
 // Maximum number of repetitions for the repeat() function
 // in the grid-template-rows and grid-template-columns properties,
 // to limit high memory usage from small stylesheets.
 // Must be a positive integer. Should be large-ish.
 #define GRID_TEMPLATE_MAX_REPETITIONS 10000
 
 // End-of-array marker for mask arguments to ParseBitmaskValues
 #define MASK_END_VALUE  (-1)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -3355,16 +3355,27 @@ nsCSSProps::gPropertyUseCounter[eCSSProp
                    kwtable_, stylestruct_, stylestructoffset_, animtype_) \
     static_cast<UseCounter>(USE_COUNTER_FOR_CSS_PROPERTY_##method_),
   #include "nsCSSPropList.h"
   #undef CSS_PROP
   #undef CSS_PROP_LIST_INCLUDE_LOGICAL
   #undef CSS_PROP_PUBLIC_OR_PRIVATE
 };
 
+const uint32_t
+nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = {
+#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
+                 stylestruct_, stylestructoffset_, animtype_)                 \
+  parsevariant_,
+#define CSS_PROP_LIST_INCLUDE_LOGICAL
+#include "nsCSSPropList.h"
+#undef CSS_PROP_LIST_INCLUDE_LOGICAL
+#undef CSS_PROP
+};
+
 // Check that all logical property flags are used appropriately.
 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_,         \
                  kwtable_, stylestruct_, stylestructoffset_, animtype_)     \
   static_assert(!((flags_) & CSS_PROPERTY_LOGICAL),                         \
                 "only properties defined with CSS_PROP_LOGICAL can use "    \
                 "the CSS_PROPERTY_LOGICAL flag");                           \
   static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_AXIS),                    \
                 "only properties defined with CSS_PROP_LOGICAL can use "    \
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -490,17 +490,16 @@ public:
   {
     MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
                "out of range");
     return nsCSSProps::kFlagsTable[aProperty] &
            CSS_PROPERTY_VALUE_RESTRICTION_MASK;
   }
 
 private:
-  // Lives in nsCSSParser.cpp for the macros it depends on.
   static const uint32_t kParserVariantTable[eCSSProperty_COUNT_no_shorthands];
 
 public:
   static inline uint32_t ParserVariant(nsCSSPropertyID aProperty) {
     MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
                "out of range");
     return nsCSSProps::kParserVariantTable[aProperty];
   }