Bug 753397. Add a field to nsCSSPropList for a preference that controls the property. r=dbaron

The actual controlling is not hooked up yet; that will happen in bug 753522 for
the DOM reflections of properties.
This commit is contained in:
Boris Zbarsky 2012-05-09 21:29:37 -04:00
Родитель af3a741c2a
Коммит 82bc5b339c
10 изменённых файлов: 445 добавлений и 148 удалений

Просмотреть файл

@ -40,17 +40,17 @@
#include "nsICSSDeclaration.h"
#define CSS_PROP_DOMPROP_PREFIXED(prop_) Moz ## prop_
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
#define CSS_PROP(name_, id_, method_, flags_, pref_, 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)
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
CSS_PROP(name_, id_, method_, flags_, pref_, X, X, X, X, X)
#include "nsCSSPropList.h"
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
CSS_PROP(X, propid_, aliasmethod_, X, X, X, X, X, X)
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
CSS_PROP(X, propid_, aliasmethod_, X, pref_, X, X, X, X, X)
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS

Просмотреть файл

@ -174,8 +174,8 @@ using namespace mozilla;
// This lives here because it depends on the above macros.
const PRUint32
nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
parsevariant_,
#include "nsCSSPropList.h"
#undef CSS_PROP

Просмотреть файл

@ -61,5 +61,9 @@
nsCSSPropList.h, prefixes should just be included in this file (rather
than needing the CSS_PROP_DOMPROP_PREFIXED(prop) macro).
-. 'pref' is the name of a pref that controls whether the property
is enabled. The property is enabled if 'pref' is an empty string,
or if the boolean property whose name is 'pref' is set to true.
******/

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -51,8 +51,8 @@
enum nsCSSProperty {
eCSSProperty_UNKNOWN = -1,
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
eCSSProperty_##id_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -61,7 +61,8 @@ enum nsCSSProperty {
// Make the count continue where it left off:
eCSSProperty_COUNT_DUMMY = eCSSProperty_COUNT_no_shorthands - 1,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) eCSSProperty_##id_,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
eCSSProperty_##id_,
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND

Просмотреть файл

@ -63,12 +63,12 @@ extern const char* const kCSSRawProperties[];
// define an array of all CSS properties
const char* const kCSSRawProperties[] = {
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#name_,
#include "nsCSSPropList.h"
#undef CSS_PROP
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) #name_,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) #name_,
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
};
@ -319,7 +319,7 @@ nsCSSProps::ReleaseTable(void)
// We need eCSSAliasCount so we can make gAliases nonzero size when there
// are no aliases.
enum {
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
eCSSAliasCountBefore_##aliasmethod_,
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS
@ -337,7 +337,7 @@ enum {
// conveniently zero.
// eMaxCSSAliasNameSizeWith_##aliasmethod_ is **one less than** the
// largest sizeof(#aliasname_) before or including that alias.
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
eMaxCSSAliasNameSizeBefore_##aliasmethod_, \
eMaxCSSAliasNameSizeWith_##aliasmethod_ = \
PR_MAX(sizeof(#aliasname_), eMaxCSSAliasNameSizeBefore_##aliasmethod_) - 1,
@ -353,7 +353,7 @@ struct CSSPropertyAlias {
};
static const CSSPropertyAlias gAliases[PR_MAX(eCSSAliasCount, 1)] = {
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
{ #aliasname_, eCSSProperty_##propid_ },
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS
@ -1572,8 +1572,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_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
kwtable_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1617,8 +1617,8 @@ const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] =
// Note that this uses the special BackendOnly style struct ID
// (which does need to be valid for storing in the
// nsCSSCompressedDataBlock::mStyleBits bitfield).
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
eStyleStruct_##stylestruct_,
#include "nsCSSPropList.h"
@ -1628,8 +1628,8 @@ const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] =
const nsStyleAnimType
nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
animtype_,
#include "nsCSSPropList.h"
#undef CSS_PROP
@ -1637,20 +1637,20 @@ nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
const ptrdiff_t
nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
stylestructoffset_,
#include "nsCSSPropList.h"
#undef CSS_PROP
};
const PRUint32 nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
flags_,
#include "nsCSSPropList.h"
#undef CSS_PROP
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) flags_,
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
};
@ -2145,7 +2145,8 @@ nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shortha
// Need an extra level of macro nesting to force expansion of method_
// params before they get pasted.
#define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) NSCSSPROPS_INNER_MACRO(method_)
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
NSCSSPROPS_INNER_MACRO(method_)
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
#undef NSCSSPROPS_INNER_MACRO
@ -2153,8 +2154,9 @@ nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shortha
};
#define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, parsevariant_, \
kwtable_, stylestructoffset_, animtype_) \
#define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, pref_, \
parsevariant_, kwtable_, stylestructoffset_, \
animtype_) \
ePropertyIndex_for_##id_,
// The order of these enums must match the g*Flags arrays in nsRuleNode.cpp.
@ -2333,11 +2335,11 @@ nsCSSProps::gPropertyCountInStruct[nsStyleStructID_Length] = {
/* static */ const size_t
nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, parsevariant_, \
kwtable_) \
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, \
parsevariant_, kwtable_) \
size_t(-1),
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
ePropertyIndex_for_##id_,
#include "nsCSSPropList.h"
#undef CSS_PROP

Просмотреть файл

@ -344,8 +344,8 @@ nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
// nsIDOMCSS2Properties
#define CSS_PROP_DOMPROP_PREFIXED(prop_) Moz ## prop_
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
NS_IMETHODIMP \
nsDOMCSSDeclaration::Get##method_(nsAString& aValue) \
{ \
@ -359,12 +359,12 @@ 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)
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
CSS_PROP(name_, id_, method_, flags_, pref_, X, X, X, X, X)
#include "nsCSSPropList.h"
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
CSS_PROP(X, propid_, aliasmethod_, X, X, X, X, X, X)
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
CSS_PROP(X, propid_, aliasmethod_, X, pref_, X, X, X, X, X)
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS

Просмотреть файл

@ -126,8 +126,8 @@ struct nsRuleData
* mSIDs.
*/
#define CSS_PROP_DOMPROP_PREFIXED(prop_) prop_
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
nsCSSValue* ValueFor##method_() { \
NS_ABORT_IF_FALSE(mSIDs & NS_STYLE_INHERIT_BIT(stylestruct_), \
"Calling nsRuleData::ValueFor" #method_ " without " \
@ -143,8 +143,8 @@ struct nsRuleData
const nsCSSValue* ValueFor##method_() const { \
return const_cast<nsRuleData*>(this)->ValueFor##method_(); \
}
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, parsevariant_, \
kwtable_) \
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, \
parsevariant_, kwtable_) \
/* empty; backend-only structs are not in nsRuleData */
#include "nsCSSPropList.h"
#undef CSS_PROP

Просмотреть файл

@ -1468,8 +1468,9 @@ CheckTextCallback(const nsRuleData* aRuleData,
return aResult;
}
#define FLAG_DATA_FOR_PROPERTY(name_, id_, method_, flags_, parsevariant_, \
kwtable_, stylestructoffset_, animtype_) \
#define FLAG_DATA_FOR_PROPERTY(name_, id_, method_, flags_, pref_, \
parsevariant_, kwtable_, stylestructoffset_, \
animtype_) \
flags_,
// The order here must match the enums in *CheckCounter in nsCSSProps.cpp.

Просмотреть файл

@ -49,8 +49,8 @@ struct PropertyInfo {
const PropertyInfo gLonghandProperties[] = {
#define CSS_PROP_DOMPROP_PREFIXED(prop_) Moz ## prop_
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
{ #name_, #method_ },
#include "nsCSSPropList.h"
@ -68,8 +68,8 @@ const PropertyInfo gLonghandProperties[] = {
const char* gLonghandPropertiesWithDOMProp[] = {
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
#name_,
#include "nsCSSPropList.h"
@ -85,7 +85,7 @@ const PropertyInfo gShorthandProperties[] = {
// Need an extra level of macro nesting to force expansion of method_
// params before they get pasted.
#define LISTCSSPROPERTIES_INNER_MACRO(method_) #method_,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) \
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
{ #name_, LISTCSSPROPERTIES_INNER_MACRO(method_) },
#include "nsCSSPropList.h"
@ -100,7 +100,7 @@ const PropertyInfo gShorthandProperties[] = {
const char* gShorthandPropertiesWithDOMProp[] = {
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) \
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
#name_,
#include "nsCSSPropList.h"