Add 'parsevariant_' parameter to CSS_PROP macro, with all properties initially zero. (Bug 636029) r=bzbarsky

This commit is contained in:
L. David Baron 2011-03-05 09:58:33 -08:00
parent 92c4c1e812
commit 08ab704b49
9 changed files with 334 additions and 87 deletions

View File

@ -40,21 +40,22 @@
#include "nsICSSDeclaration.h"
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
static const nsCSSProperty QS_CSS_PROP_##method_ = eCSSProperty_##id_;
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) \
CSS_PROP(name_, id_, method_, flags_, X, X, X, X, X, X)
CSS_PROP(name_, id_, method_, flags_, X, X, X, X, X, X, X)
#include "nsCSSPropList.h"
// Aliases
CSS_PROP(X, opacity, MozOpacity, X, X, X, X, X, X, X)
CSS_PROP(X, outline, MozOutline, X, X, X, X, X, X, X)
CSS_PROP(X, outline_color, MozOutlineColor, X, X, X, X, X, X, X)
CSS_PROP(X, outline_style, MozOutlineStyle, X, X, X, X, X, X, X)
CSS_PROP(X, outline_width, MozOutlineWidth, X, X, X, X, X, X, X)
CSS_PROP(X, outline_offset, MozOutlineOffset, X, X, X, X, X, X, X)
CSS_PROP(X, opacity, MozOpacity, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline, MozOutline, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_color, MozOutlineColor, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_style, MozOutlineStyle, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_width, MozOutlineWidth, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_offset, MozOutlineOffset, X, X, X, X, X, X, X, X)
#undef CSS_PROP_SHORTHAND
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL

View File

@ -333,7 +333,8 @@ nsCSSExpandedDataBlock::~nsCSSExpandedDataBlock()
const size_t
nsCSSExpandedDataBlock::kOffsetTable[] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_,\
animtype_) \
offsetof(nsCSSExpandedDataBlock, m##datastruct_.member_),
#include "nsCSSPropList.h"
#undef CSS_PROP

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,8 @@ enum nsCSSProperty {
eCSSProperty_UNKNOWN = -1,
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, \
stylestructoffset_, animtype_) \
eCSSProperty_##id_,
#include "nsCSSPropList.h"
#undef CSS_PROP

View File

@ -61,7 +61,8 @@ extern const char* const kCSSRawProperties[];
// define an array of all CSS properties
const char* const kCSSRawProperties[] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
#name_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1516,7 +1517,8 @@ nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
/* static */ const PRInt32* const
nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
kwtable_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1561,7 +1563,8 @@ const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] =
// (which does need to be valid for storing in the
// nsCSSCompressedDataBlock::mStyleBits bitfield).
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_,\
animtype_) \
eStyleStruct_##stylestruct_,
#include "nsCSSPropList.h"
@ -1572,7 +1575,8 @@ const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] =
const nsStyleAnimType
nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
animtype_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1581,7 +1585,8 @@ nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
const ptrdiff_t
nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
stylestructoffset_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1589,7 +1594,8 @@ nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
const PRUint32 nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
flags_,
#include "nsCSSPropList.h"
#undef CSS_PROP

View File

@ -338,7 +338,8 @@ nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
// nsIDOMCSS2Properties
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
NS_IMETHODIMP \
nsDOMCSSDeclaration::Get##method_(nsAString& aValue) \
{ \
@ -353,16 +354,16 @@ nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) \
CSS_PROP(name_, id_, method_, flags_, X, X, X, X, X, X)
CSS_PROP(name_, id_, method_, flags_, X, X, X, X, X, X, X)
#include "nsCSSPropList.h"
// Aliases
CSS_PROP(X, opacity, MozOpacity, X, X, X, X, X, X, X)
CSS_PROP(X, outline, MozOutline, X, X, X, X, X, X, X)
CSS_PROP(X, outline_color, MozOutlineColor, X, X, X, X, X, X, X)
CSS_PROP(X, outline_style, MozOutlineStyle, X, X, X, X, X, X, X)
CSS_PROP(X, outline_width, MozOutlineWidth, X, X, X, X, X, X, X)
CSS_PROP(X, outline_offset, MozOutlineOffset, X, X, X, X, X, X, X)
CSS_PROP(X, opacity, MozOpacity, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline, MozOutline, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_color, MozOutlineColor, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_style, MozOutlineStyle, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_width, MozOutlineWidth, X, X, X, X, X, X, X, X)
CSS_PROP(X, outline_offset, MozOutlineOffset, X, X, X, X, X, X, X, X)
#undef CSS_PROP_SHORTHAND
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL

View File

@ -50,10 +50,11 @@ struct PropertyOffsetInfo {
const PropertyOffsetInfo kOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, datastruct_, \
member_, kwtable_) \
member_, parsevariant_, kwtable_) \
{ size_t(-1), size_t(-1) },
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_,\
animtype_) \
{ offsetof(nsRuleData, m##datastruct_##Data), \
offsetof(nsRuleData##datastruct_, member_) },
#include "nsCSSPropList.h"

View File

@ -1429,7 +1429,9 @@ CheckTextCallback(const nsRuleDataStruct& aData,
// structs but not nsCSS*
#define CSS_PROP_INCLUDE_NOT_CSS
#define CHECK_DATA_FOR_PROPERTY(name_, id_, method_, flags_, datastruct_, member_, kwtable_, stylestructoffset_, animtype_) \
#define CHECK_DATA_FOR_PROPERTY(name_, id_, method_, flags_, datastruct_, \
member_, parsevariant_, kwtable_, \
stylestructoffset_, animtype_) \
{ offsetof(nsRuleData##datastruct_, member_), flags_ },
static const PropertyCheckData FontCheckProperties[] = {

View File

@ -49,7 +49,8 @@ struct PropertyInfo {
const PropertyInfo gLonghandProperties[] = {
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
{ #name_, #method_ },
#include "nsCSSPropList.h"
@ -67,7 +68,8 @@ const char* gLonghandPropertiesWithDOMProp[] = {
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
parsevariant_, kwtable_, stylestruct_, stylestructoffset_, \
animtype_) \
#name_,
#include "nsCSSPropList.h"