Bug 1420383 - Move nsCSSProps::kParserVariantTable into its rightful home in nsCSSProps.cpp. r?xidorn
MozReview-Commit-ID: 7Rg3EYq5GPQ
--- 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];
}