From d5b9a00b6bebf4a0e748dd98bc028a7575cfb610 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 14 May 2013 14:20:58 -0400 Subject: [PATCH] Bug 870845. Correctly check for parse-inaccessible properties in inDOMUtils::GetCSSPropertyNames. r=heycam --- layout/inspector/src/inDOMUtils.cpp | 4 ++-- layout/style/nsCSSProps.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/layout/inspector/src/inDOMUtils.cpp b/layout/inspector/src/inDOMUtils.cpp index c61c996ad38..7415cc03126 100644 --- a/layout/inspector/src/inDOMUtils.cpp +++ b/layout/inspector/src/inDOMUtils.cpp @@ -389,8 +389,8 @@ inDOMUtils::GetCSSPropertyNames(uint32_t aFlags, uint32_t* aCount, // 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); } } diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index b18dc8af8d8..c3a7064b3d4 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -228,6 +228,10 @@ public: { 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; }