Bug 1456364 part 2 - Remove PropertyParseType. r=emilio
authorXidorn Quan <me@upsuper.org>
Thu, 26 Apr 2018 15:00:50 +1000
changeset 415776 344b5a9033f0c2243d63aad697058b9162e9df57
parent 415775 46b7f067934af4c1baab611de2ecabf18d4a928f
child 415777 eff909bc29a76558394e6075fab02e63aefb3068
push id33910
push usershindli@mozilla.com
push dateThu, 26 Apr 2018 21:39:52 +0000
treeherdermozilla-central@63a0e2f626fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1456364
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 1456364 part 2 - Remove PropertyParseType. r=emilio MozReview-Commit-ID: 3JDLVKJAlpv
layout/inspector/InspectorUtils.cpp
layout/style/nsCSSProps.h
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -376,18 +376,18 @@ InspectorUtils::GetCSSPropertyNames(Glob
     if (nsCSSProps::IsEnabled(cssProp, enabledState)) {
       nsDependentCString name(kCSSRawProperties[prop]);
       aResult.AppendElement(NS_ConvertASCIItoUTF16(name));
     }
   };
 
   uint32_t prop = 0;
   for ( ; prop < eCSSProperty_COUNT_no_shorthands; ++prop) {
-    if (nsCSSProps::PropertyParseType(nsCSSPropertyID(prop)) !=
-        CSS_PROPERTY_PARSE_INACCESSIBLE) {
+    if (!nsCSSProps::PropHasFlags(nsCSSPropertyID(prop),
+                                  CSS_PROPERTY_PARSE_INACCESSIBLE)) {
       appendProperty(prop);
     }
   }
 
   if (aOptions.mIncludeShorthands) {
     for ( ; prop < eCSSProperty_COUNT; ++prop) {
       appendProperty(prop);
     }
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -119,20 +119,16 @@
 #define VARIANT_LPCALC (VARIANT_LCALC | VARIANT_PERCENT)
 #define VARIANT_LNCALC (VARIANT_LCALC | VARIANT_NUMBER)
 #define VARIANT_LPNCALC (VARIANT_LNCALC | VARIANT_PERCENT)
 #define VARIANT_IMAGE   (VARIANT_URL | VARIANT_NONE | VARIANT_GRADIENT | \
                         VARIANT_IMAGE_RECT | VARIANT_ELEMENT)
 
 // Flags for the kFlagsTable bitfield (flags_ in nsCSSPropList.h)
 
-// Define what mechanism the CSS parser uses for parsing the property.
-// See CSSParserImpl::ParseProperty(nsCSSPropertyID).  Don't use 0 so that
-// we can verify that every property sets one of the values.
-#define CSS_PROPERTY_PARSE_PROPERTY_MASK          (7<<9)
 #define CSS_PROPERTY_PARSE_INACCESSIBLE           (1<<9)
 
 // There's a free bit here.
 
 // This property's getComputedStyle implementation requires layout to be
 // flushed.
 #define CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH     (1<<20)
 
@@ -284,31 +280,19 @@ public:
 private:
   static const uint32_t        kFlagsTable[eCSSProperty_COUNT];
 
 public:
   static inline bool PropHasFlags(nsCSSPropertyID aProperty, uint32_t aFlags)
   {
     MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
                "out of range");
-    MOZ_ASSERT(!(aFlags & CSS_PROPERTY_PARSE_PROPERTY_MASK),
-               "The CSS_PROPERTY_PARSE_* values are not bitflags; don't pass "
-               "them to PropHasFlags.  You probably want PropertyParseType "
-               "instead.");
     return (nsCSSProps::kFlagsTable[aProperty] & aFlags) == aFlags;
   }
 
-  static inline uint32_t PropertyParseType(nsCSSPropertyID aProperty)
-  {
-    MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
-               "out of range");
-    return nsCSSProps::kFlagsTable[aProperty] &
-           CSS_PROPERTY_PARSE_PROPERTY_MASK;
-  }
-
 private:
   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];