Bug 1456364 part 4 - Convert CSS_PROPERTY_* flags to a typed enum flags. r=emilio
authorXidorn Quan <me@upsuper.org>
Thu, 26 Apr 2018 15:00:50 +1000
changeset 469323 47db02b5cdc975f919f5118f68520426d807ed49
parent 469322 eff909bc29a76558394e6075fab02e63aefb3068
child 469324 93cf389546fdaa2679508d2486933cd80baa1c5f
push id9171
push userryanvm@gmail.com
push dateSat, 28 Apr 2018 10:35:57 +0000
treeherdermozilla-beta@89f3ba72015a [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 4 - Convert CSS_PROPERTY_* flags to a typed enum flags. r=emilio MozReview-Commit-ID: 4mLPe5cH80N
devtools/shared/css/generated/mach_commands.py
dom/animation/EffectCompositor.cpp
dom/animation/KeyframeEffectReadOnly.cpp
dom/bindings/GenerateCSS2PropertiesWebIDL.py
layout/inspector/InspectorUtils.cpp
layout/painting/nsDisplayList.cpp
layout/style/CSSPropFlags.h
layout/style/GenerateCSSPropsGenerated.py
layout/style/GenerateServoCSSPropList.py
layout/style/LayerAnimationInfo.cpp
layout/style/ServoCSSPropList.mako.py
layout/style/moz.build
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsTransitionManager.cpp
--- a/devtools/shared/css/generated/mach_commands.py
+++ b/devtools/shared/css/generated/mach_commands.py
@@ -56,17 +56,17 @@ class MachCommands(MachCommandBase):
         with open(dataPath, "r") as f:
             data = eval(f.read())
 
         # Map this list
         # (name, prop, id, flags, pref, proptype) => (name, pref)
         preferences = [
             (name, pref)
             for name, prop, id, flags, pref, proptype in data
-            if 'CSS_PROPERTY_INTERNAL' not in flags and pref]
+            if 'CSSPropFlags::Internal' not in flags and pref]
 
         return preferences
 
     def get_properties_db_from_xpcshell(self):
         """Generate the static css properties db for devtools from an xpcshell script."""
         build = MozbuildObject.from_environment()
 
         # Get the paths
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -604,17 +604,17 @@ EffectCompositor::GetOverriddenPropertie
   }
 
   AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
   {
     nsCSSPropertyIDSet propertiesToTrackAsSet;
     for (KeyframeEffectReadOnly* effect : aEffectSet) {
       for (const AnimationProperty& property : effect->Properties()) {
         if (nsCSSProps::PropHasFlags(property.mProperty,
-                                     CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
+                                     CSSPropFlags::CanAnimateOnCompositor) &&
             !propertiesToTrackAsSet.HasProperty(property.mProperty)) {
           propertiesToTrackAsSet.AddProperty(property.mProperty);
           propertiesToTrack.AppendElement(property.mProperty);
         }
       }
       // Skip iterating over the rest of the effects if we've already
       // found all the compositor-animatable properties.
       if (propertiesToTrack.Length() == LayerAnimationInfo::kRecords) {
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -494,17 +494,17 @@ KeyframeEffectReadOnly::IsRunningOnCompo
   return false;
 }
 
 void
 KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSPropertyID aProperty,
                                                  bool aIsRunning)
 {
   MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
-                                      CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
+                                      CSSPropFlags::CanAnimateOnCompositor),
              "Property being animated on compositor is a recognized "
              "compositor-animatable property");
   for (AnimationProperty& property : mProperties) {
     if (property.mProperty == aProperty) {
       property.mIsRunningOnCompositor = aIsRunning;
       // We currently only set a performance warning message when animations
       // cannot be run on the compositor, so if this animation is running
       // on the compositor we don't need a message.
--- a/dom/bindings/GenerateCSS2PropertiesWebIDL.py
+++ b/dom/bindings/GenerateCSS2PropertiesWebIDL.py
@@ -12,17 +12,17 @@ import argparse
 def generateLine(propName, extendedAttrs):
     return "  [%s] attribute DOMString %s;\n" % (", ".join(extendedAttrs),
                                                  propName)
 def generate(output, idlFilename, dataFile):
     with open(dataFile, "r") as f:
         propList = eval(f.read())
     props = ""
     for name, prop, id, flags, pref, proptype in propList:
-        if "CSS_PROPERTY_INTERNAL" in flags:
+        if "CSSPropFlags::Internal" in flags:
             continue
         # Unfortunately, even some of the getters here are fallible
         # (e.g. on nsComputedDOMStyle).
         extendedAttrs = ["CEReactions", "Throws", "TreatNullAs=EmptyString",
                          "SetterNeedsSubjectPrincipal=NonSystem"]
         if pref is not "":
             extendedAttrs.append('Pref="%s"' % pref)
 
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -377,17 +377,17 @@ InspectorUtils::GetCSSPropertyNames(Glob
       nsDependentCString name(kCSSRawProperties[prop]);
       aResult.AppendElement(NS_ConvertASCIItoUTF16(name));
     }
   };
 
   uint32_t prop = 0;
   for ( ; prop < eCSSProperty_COUNT_no_shorthands; ++prop) {
     if (!nsCSSProps::PropHasFlags(nsCSSPropertyID(prop),
-                                  CSS_PROPERTY_PARSE_INACCESSIBLE)) {
+                                  CSSPropFlags::Inaccessible)) {
       appendProperty(prop);
     }
   }
 
   if (aOptions.mIncludeShorthands) {
     for ( ; prop < eCSSProperty_COUNT; ++prop) {
       appendProperty(prop);
     }
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -676,17 +676,17 @@ AddAnimationsForProperty(nsIFrame* aFram
     data = TransformData(origin, offsetToTransformOrigin,
                          bounds, devPixelsToAppUnits,
                          scaleX, scaleY, hasPerspectiveParent);
   } else if (aProperty == eCSSProperty_opacity) {
     data = null_t();
   }
 
   MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
-                                      CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
+                                      CSSPropFlags::CanAnimateOnCompositor),
              "inconsistent property flags");
 
   // Add from first to last (since last overrides)
   for (size_t animIdx = 0; animIdx < compositorAnimations.Length(); animIdx++) {
     dom::Animation* anim = compositorAnimations[animIdx];
     if (!anim->IsRelevant()) {
       continue;
     }
@@ -809,17 +809,17 @@ GenerateAndPushTextMask(nsIFrame* aFrame
 /* static */ void
 nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(Layer* aLayer,
                                                          nsDisplayListBuilder* aBuilder,
                                                          nsDisplayItem* aItem,
                                                          nsIFrame* aFrame,
                                                          nsCSSPropertyID aProperty)
 {
   MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
-                                      CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
+                                      CSSPropFlags::CanAnimateOnCompositor),
              "inconsistent property flags");
 
   // This function can be called in two ways:  from
   // nsDisplay*::BuildLayer while constructing a layer (with all
   // pointers non-null), or from RestyleManager's handling of
   // UpdateOpacityLayer/UpdateTransformLayer hints.
   MOZ_ASSERT(!aBuilder == !aItem,
              "should only be called in two configurations, with both "
new file mode 100644
--- /dev/null
+++ b/layout/style/CSSPropFlags.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_CSSPropFlags_h
+#define mozilla_CSSPropFlags_h
+
+#include "mozilla/TypedEnumBits.h"
+
+namespace mozilla {
+
+enum class CSSPropFlags : uint8_t
+{
+  // This property is not parsed. It is only there for internal use like
+  // attribute mapping.
+  Inaccessible = 1 << 0,
+
+  // This property's getComputedStyle implementation requires layout to
+  // be flushed.
+  GetCSNeedsLayoutFlush = 1 << 1,
+
+  // The following two flags along with the pref defines where the this
+  // property can be used:
+  // * If none of the two flags is presented, the pref completely controls
+  //   the availability of this property. And in that case, if it has no
+  //   pref, this property is usable everywhere.
+  // * If any of the flags is set, this property is always enabled in the
+  //   specific contexts regardless of the value of the pref. If there is
+  //   no pref for this property at all in this case, it is an internal-
+  //   only property, which cannot be used anywhere else, and should be
+  //   wrapped in "#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL".
+  // Note that, these flags have no effect on the use of aliases of this
+  // property.
+  // Furthermore, for the purposes of animation (including triggering
+  // transitions) these flags are ignored. That is, if the property is disabled
+  // by a pref, we will *not* run animations or transitions on it even in
+  // UA sheets or chrome.
+  EnabledInUASheets = 1 << 2,
+  EnabledInChrome = 1 << 3,
+  EnabledInUASheetsAndChrome = EnabledInUASheets | EnabledInChrome,
+  EnabledMask = EnabledInUASheetsAndChrome,
+
+  // This property can be animated on the compositor.
+  CanAnimateOnCompositor = 1 << 4,
+
+  // This property is an internal property that is not represented in
+  // the DOM. Properties with this flag are defined in an #ifndef
+  // CSS_PROP_LIST_EXCLUDE_INTERNAL section.
+  Internal = 1 << 5,
+};
+
+MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CSSPropFlags)
+
+} // namespace mozilla
+
+#endif // mozilla_CSSPropFlags_h
--- a/layout/style/GenerateCSSPropsGenerated.py
+++ b/layout/style/GenerateCSSPropsGenerated.py
@@ -23,17 +23,17 @@ def get_properties(dataFile):
 
     properties = sorted(properties, cmp=property_compare)
 
     for i, p in enumerate(properties):
         p["index"] = i
 
     # Record each property's IDL name.
     for p in properties:
-        if "CSS_PROPERTY_INTERNAL" in p["flags"]:
+        if "CSSPropFlags::Internal" in p["flags"]:
             p["idlname"] = None
         else:
             idl_name = p["prop"]
             if not idl_name.startswith("Moz"):
                 idl_name = idl_name[0].lower() + idl_name[1:]
             p["idlname"] = idl_name
 
     return properties
--- a/layout/style/GenerateServoCSSPropList.py
+++ b/layout/style/GenerateServoCSSPropList.py
@@ -64,29 +64,29 @@ def generate_header(output, data):
 """)
 
     MACRO_NAMES = {
         "longhand": "CSS_PROP_LONGHAND",
         "shorthand": "CSS_PROP_SHORTHAND",
         "alias": "CSS_PROP_ALIAS",
     }
     for name, method, id, flags, pref, proptype in data:
-        is_internal = "CSS_PROPERTY_INTERNAL" in flags
+        is_internal = "CSSPropFlags::Internal" in flags
         pref = '"' + pref + '"'
         if proptype == "alias":
             params = [name, id[0], id[1], method, pref]
         else:
             if method == "CssFloat":
                 method = "CSS_PROP_PUBLIC_OR_PRIVATE(CssFloat, Float)"
             elif method.startswith("Moz"):
                 method = "CSS_PROP_DOMPROP_PREFIXED({})".format(method[3:])
             if flags:
                 flags = " | ".join(flags)
             else:
-                flags = "0"
+                flags = "CSSPropFlags(0)"
             params = [name, id, method, flags, pref]
 
         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")
 
--- a/layout/style/LayerAnimationInfo.cpp
+++ b/layout/style/LayerAnimationInfo.cpp
@@ -19,36 +19,36 @@ namespace mozilla {
       nsChangeHint_UpdateOpacityLayer } };
 
 #ifdef DEBUG
 /* static */ void
 LayerAnimationInfo::Initialize()
 {
   for (const Record& record : sRecords) {
     MOZ_ASSERT(nsCSSProps::PropHasFlags(record.mProperty,
-                                        CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
+                                        CSSPropFlags::CanAnimateOnCompositor),
                "CSS property with entry in LayerAnimation::sRecords does not "
-               "have the CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR flag");
+               "have the CSSPropFlags::CanAnimateOnCompositor flag");
   }
 
   // Check that every property with the flag for animating on the
   // compositor has an entry in LayerAnimationInfo::sRecords.
   for (nsCSSPropertyID prop = nsCSSPropertyID(0);
        prop < eCSSProperty_COUNT;
        prop = nsCSSPropertyID(prop + 1)) {
     if (nsCSSProps::PropHasFlags(prop,
-                                 CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR)) {
+                                 CSSPropFlags::CanAnimateOnCompositor)) {
       bool found = false;
       for (const Record& record : sRecords) {
         if (record.mProperty == prop) {
           found = true;
           break;
         }
       }
       MOZ_ASSERT(found,
-                 "CSS property with the CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR "
+                 "CSS property with the CSSPropFlags::CanAnimateOnCompositor "
                  "flag does not have an entry in LayerAnimationInfo::sRecords");
     }
   }
 }
 #endif
 
 } // namespace mozilla
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -25,28 +25,28 @@ def is_internal(prop):
         "-moz-window-transform",
         "-moz-window-transform-origin",
     ]
     return prop.name in OTHER_INTERNALS
 
 def flags(prop):
     result = []
     if prop.explicitly_enabled_in_chrome():
-        result.append("CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME")
+        result.append("EnabledInUASheetsAndChrome")
     elif prop.explicitly_enabled_in_ua_sheets():
-        result.append("CSS_PROPERTY_ENABLED_IN_UA_SHEETS")
+        result.append("EnabledInUASheets")
     if is_internal(prop):
-        result.append("CSS_PROPERTY_INTERNAL")
+        result.append("Internal")
     if prop.enabled_in == "":
-        result.append("CSS_PROPERTY_PARSE_INACCESSIBLE")
+        result.append("Inaccessible")
     if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
-        result.append("CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH")
+        result.append("GetCSNeedsLayoutFlush")
     if "CAN_ANIMATE_ON_COMPOSITOR" in prop.flags:
-        result.append("CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR")
-    return ", ".join('"{}"'.format(flag) for flag in result)
+        result.append("CanAnimateOnCompositor")
+    return ", ".join('"CSSPropFlags::{}"'.format(flag) for flag in result)
 
 def pref(prop):
     if prop.gecko_pref:
         return '"' + prop.gecko_pref + '"'
     return '""'
 %>
 
 [
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -64,16 +64,17 @@ EXPORTS += [
 EXPORTS.mozilla += [
     '!ServoCSSPropList.h',
     'AnimationCollection.h',
     'BindingStyleRule.h',
     'CachedInheritingStyles.h',
     'ComputedStyle.h',
     'ComputedStyleInlines.h',
     'CSSEnabledState.h',
+    'CSSPropFlags.h',
     'DeclarationBlock.h',
     'DeclarationBlockInlines.h',
     'DocumentStyleRootIterator.h',
     'GenericSpecifiedValues.h',
     'GenericSpecifiedValuesInlines.h',
     'LayerAnimationInfo.h',
     'MediaFeatureChange.h',
     'PostTraversalTask.h',
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -70,17 +70,17 @@
 
 #define CSS_PROP_DOMPROP_PREFIXED(name_) \
   CSS_PROP_PUBLIC_OR_PRIVATE(Moz ## name_, name_)
 
 // Callers may define CSS_PROP_LIST_EXCLUDE_INTERNAL if they want to
 // exclude internal properties that are not represented in the DOM (only
 // the DOM style code defines this).  All properties defined in an
 // #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL section must have the
-// CSS_PROPERTY_INTERNAL flag set.
+// CSSPropFlags::Internal flag set.
 
 // Callers may also define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
 // to exclude properties that are not considered to be components of the 'all'
 // shorthand property.  Currently this excludes 'direction' and 'unicode-bidi',
 // as required by the CSS Cascading and Inheritance specification, and any
 // internal properties that cannot be changed by using CSS syntax.  For example,
 // the internal '-moz-system-font' property is not excluded, as it is set by the
 // 'font' shorthand, while '-x-lang' is excluded as there is no way to set this
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2253,17 +2253,17 @@ bool nsCSSProps::GetColorName(int32_t aP
     nsCSSKeywords::AddRefTable();
     aStr = nsCSSKeywords::GetStringValue(keyword);
     nsCSSKeywords::ReleaseTable();
     rv = true;
   }
   return rv;
 }
 
-const uint32_t nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
+const CSSPropFlags nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
 #define CSS_PROP_LONGHAND(name_, id_, method_, flags_, ...) flags_,
 #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[] = {
@@ -2715,17 +2715,17 @@ nsCSSProps::kSubpropertyTable[eCSSProper
 /* static */ bool
 nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
   // If the property has any "ENABLED_IN" flag set, it is disabled by
   // default. Note that, if a property has pref, whatever its default
   // value is, it will later be changed in nsCSSProps::AddRefTable().
   // If the property has "ENABLED_IN" flags but doesn't have a pref,
   // it is an internal property which is disabled elsewhere.
   #define IS_ENABLED_BY_DEFAULT(flags_) \
-    (!((flags_) & (CSS_PROPERTY_ENABLED_MASK | CSS_PROPERTY_PARSE_INACCESSIBLE)))
+    (!((flags_) & (CSSPropFlags::EnabledMask | CSSPropFlags::Inaccessible)))
 
   #define CSS_PROP_LONGHAND(name_, id_, method_, flags_, ...) \
     IS_ENABLED_BY_DEFAULT(flags_),
   #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, ...) \
     IS_ENABLED_BY_DEFAULT(flags_),
   #define CSS_PROP_ALIAS(...) true,
   #include "mozilla/ServoCSSPropList.h"
   #undef CSS_PROP_ALIAS
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -14,16 +14,17 @@
 
 #include <limits>
 #include <type_traits>
 #include "nsStringFwd.h"
 #include "nsCSSPropertyID.h"
 #include "nsStyleStructFwd.h"
 #include "nsCSSKeywords.h"
 #include "mozilla/CSSEnabledState.h"
+#include "mozilla/CSSPropFlags.h"
 #include "mozilla/UseCounter.h"
 #include "mozilla/EnumTypeTraits.h"
 #include "mozilla/Preferences.h"
 #include "nsXULAppAPI.h"
 
 // Length of the "--" prefix on custom names (such as custom property names,
 // and, in the future, custom media query names).
 #define CSS_CUSTOM_NAME_PREFIX_LENGTH 2
@@ -117,59 +118,20 @@
 #define VARIANT_LBCALC (VARIANT_LB | VARIANT_CALC)
 #define VARIANT_LCALC  (VARIANT_LENGTH | VARIANT_CALC)
 #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 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)
-
-// The following two flags along with the pref defines where the this
-// property can be used:
-// * If none of the two flags is presented, the pref completely controls
-//   the availability of this property. And in that case, if it has no
-//   pref, this property is usable everywhere.
-// * If any of the flags is set, this property is always enabled in the
-//   specific contexts regardless of the value of the pref. If there is
-//   no pref for this property at all in this case, it is an internal-
-//   only property, which cannot be used anywhere else, and should be
-//   wrapped in "#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL".
-// Note that, these flags have no effect on the use of aliases of this
-// property.
-// Furthermore, for the purposes of animation (including triggering
-// transitions) these flags are ignored. That is, if the property is disabled
-// by a pref, we will *not* run animations or transitions on it even in
-// UA sheets or chrome.
-#define CSS_PROPERTY_ENABLED_MASK                 (3<<22)
-#define CSS_PROPERTY_ENABLED_IN_UA_SHEETS         (1<<22)
-#define CSS_PROPERTY_ENABLED_IN_CHROME            (1<<23)
-#define CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME \
-  (CSS_PROPERTY_ENABLED_IN_UA_SHEETS | CSS_PROPERTY_ENABLED_IN_CHROME)
-
-// This property can be animated on the compositor.
-#define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR    (1<<27)
-
-// This property is an internal property that is not represented
-// in the DOM.  Properties with this flag must be defined in an #ifndef
-// CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
-#define CSS_PROPERTY_INTERNAL                     (1<<28)
-
 class nsCSSProps {
 public:
   typedef mozilla::CSSEnabledState EnabledState;
+  typedef mozilla::CSSPropFlags Flags;
 
   struct KTableEntry
   {
     // KTableEntry objects can be initialized either with an int16_t value
     // or a value of an enumeration type that can fit within an int16_t.
 
     constexpr KTableEntry(nsCSSKeyword aKeyword, int16_t aValue)
       : mKeyword(aKeyword)
@@ -273,20 +235,20 @@ public:
     static_assert(mozilla::EnumTypeFitsWithin<T, int16_t>::value,
                   "aValue must be an enum that fits within KTableEntry::mValue");
     return ValueToKeyword(static_cast<int16_t>(aValue), aTable);
   }
 
   static const KTableEntry* const kKeywordTableTable[eCSSProperty_COUNT_no_shorthands];
 
 private:
-  static const uint32_t        kFlagsTable[eCSSProperty_COUNT];
+  static const Flags kFlagsTable[eCSSProperty_COUNT];
 
 public:
-  static inline bool PropHasFlags(nsCSSPropertyID aProperty, uint32_t aFlags)
+  static inline bool PropHasFlags(nsCSSPropertyID aProperty, Flags aFlags)
   {
     MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
                "out of range");
     return (nsCSSProps::kFlagsTable[aProperty] & aFlags) == aFlags;
   }
 
 private:
   static const uint32_t kParserVariantTable[eCSSProperty_COUNT_no_shorthands];
@@ -381,22 +343,22 @@ public:
   {
     if (IsEnabled(aProperty)) {
       return true;
     }
     if (aEnabled == EnabledState::eIgnoreEnabledState) {
       return true;
     }
     if ((aEnabled & EnabledState::eInUASheets) &&
-        PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_UA_SHEETS))
+        PropHasFlags(aProperty, Flags::EnabledInUASheets))
     {
       return true;
     }
     if ((aEnabled & EnabledState::eInChrome) &&
-        PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_CHROME))
+        PropHasFlags(aProperty, Flags::EnabledInChrome))
     {
       return true;
     }
     return false;
   }
 
 public:
 
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -181,17 +181,17 @@ struct ComputedStyleMap
     typedef already_AddRefed<CSSValue> (nsComputedDOMStyle::*ComputeMethod)();
 
     nsCSSPropertyID mProperty;
     ComputeMethod mGetter;
 
     bool IsLayoutFlushNeeded() const
     {
       return nsCSSProps::PropHasFlags(mProperty,
-                                      CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH);
+                                      CSSPropFlags::GetCSNeedsLayoutFlush);
     }
 
     bool IsEnabled() const
     {
       return nsCSSProps::IsEnabled(mProperty, CSSEnabledState::eForAllContent);
     }
   };
 
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -74,17 +74,17 @@ ElementPropertyTransition::CurrentValueP
 
 void
 ElementPropertyTransition::UpdateStartValueFromReplacedTransition()
 {
   if (!mReplacedTransition) {
     return;
   }
   MOZ_ASSERT(nsCSSProps::PropHasFlags(TransitionProperty(),
-                                      CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
+                                      CSSPropFlags::CanAnimateOnCompositor),
              "The transition property should be able to be run on the "
              "compositor");
   MOZ_ASSERT(mTarget && mTarget->mElement->OwnerDoc(),
              "We should have a valid document at this moment");
 
   dom::DocumentTimeline* timeline = mTarget->mElement->OwnerDoc()->Timeline();
   ComputedTiming computedTiming = GetComputedTimingAt(
     dom::CSSTransition::GetCurrentTimeAt(*timeline,