Bug 870845. Correctly check for parse-inaccessible properties in inDOMUtils::GetCSSPropertyNames. r=heycam
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 14 May 2013 14:20:58 -0400
changeset 131931 1835839d5a619a48f9baea0ea6a98495402162e5
parent 131930 8cec78f353926f62b9da00fe4e03c7af31b6e246
child 131932 1d3b60ab634a346cd61e288ec6b9a6629552f539
push id28041
push userbzbarsky@mozilla.com
push dateWed, 15 May 2013 02:18:02 +0000
treeherdermozilla-inbound@1d3b60ab634a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs870845
milestone24.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 870845. Correctly check for parse-inaccessible properties in inDOMUtils::GetCSSPropertyNames. r=heycam
layout/inspector/src/inDOMUtils.cpp
layout/style/nsCSSProps.h
--- a/layout/inspector/src/inDOMUtils.cpp
+++ b/layout/inspector/src/inDOMUtils.cpp
@@ -384,18 +384,18 @@ inDOMUtils::GetCSSPropertyNames(uint32_t
       ++propCount;                                                      \
     }                                                                   \
   PR_END_MACRO
 
   // prop is the property id we're considering; propCount is how many properties
   // we've put into props so far.
   uint32_t prop = 0, propCount = 0;
   for ( ; prop < eCSSProperty_COUNT_no_shorthands; ++prop) {
-    if (!nsCSSProps::PropHasFlags(nsCSSProperty(prop),
-                                  CSS_PROPERTY_PARSE_INACCESSIBLE)) {
+    if (nsCSSProps::PropertyParseType(nsCSSProperty(prop)) !=
+        CSS_PROPERTY_PARSE_INACCESSIBLE) {
       DO_PROP(prop);
     }
   }
 
   if (!(aFlags & EXCLUDE_SHORTHANDS)) {
     for ( ; prop < eCSSProperty_COUNT; ++prop) {
       // Some shorthands are also aliases
       if ((aFlags & INCLUDE_ALIASES) ||
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -223,16 +223,20 @@ public:
 private:
   static const uint32_t        kFlagsTable[eCSSProperty_COUNT];
 
 public:
   static inline bool PropHasFlags(nsCSSProperty aProperty, uint32_t aFlags)
   {
     NS_ABORT_IF_FALSE(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(nsCSSProperty aProperty)
   {
     NS_ABORT_IF_FALSE(0 <= aProperty && aProperty < eCSSProperty_COUNT,
                       "out of range");
     return nsCSSProps::kFlagsTable[aProperty] &