Backed out 3 changesets (bug 1069192) for OS X debug M(oth) crashes

Backed out changeset e86111412050 (bug 1069192)
Backed out changeset a5f11c5c5bcb (bug 1069192)
Backed out changeset a4aaaac8f133 (bug 1069192)
This commit is contained in:
Nigel Babu 2015-10-02 15:08:43 +05:30
parent 6467495d3d
commit 5b78a22ad9
11 changed files with 99 additions and 157 deletions

View File

@ -511,14 +511,14 @@ inDOMUtils::GetCSSPropertyNames(uint32_t aFlags, uint32_t* aCount,
char16_t** props =
static_cast<char16_t**>(moz_xmalloc(maxCount * sizeof(char16_t*)));
#define DO_PROP(_prop) \
PR_BEGIN_MACRO \
nsCSSProperty cssProp = nsCSSProperty(_prop); \
if (nsCSSProps::IsEnabled(cssProp, nsCSSProps::eEnabledForAllContent)) { \
props[propCount] = \
ToNewUnicode(nsDependentCString(kCSSRawProperties[_prop])); \
++propCount; \
} \
#define DO_PROP(_prop) \
PR_BEGIN_MACRO \
nsCSSProperty cssProp = nsCSSProperty(_prop); \
if (nsCSSProps::IsEnabled(cssProp)) { \
props[propCount] = \
ToNewUnicode(nsDependentCString(kCSSRawProperties[_prop])); \
++propCount; \
} \
PR_END_MACRO
// prop is the property id we're considering; propCount is how many properties

View File

@ -1252,7 +1252,7 @@ Declaration::ToString(nsAString& aString) const
continue;
}
if (!nsCSSProps::IsEnabled(property, nsCSSProps::eEnabledForAllContent)) {
if (!nsCSSProps::IsEnabled(property)) {
continue;
}
bool doneProperty = false;

View File

@ -323,9 +323,6 @@ public:
if (mUnsafeRulesEnabled) {
enabledState |= nsCSSProps::eEnabledInUASheets;
}
if (mIsChrome) {
enabledState |= nsCSSProps::eEnabledInChrome;
}
return enabledState;
}
@ -1212,9 +1209,6 @@ protected:
// True if unsafe rules should be allowed
bool mUnsafeRulesEnabled : 1;
// True if we are in parsing rules for the chrome.
bool mIsChrome : 1;
// True if viewport units should be allowed.
bool mViewportUnitsEnabled : 1;
@ -1338,7 +1332,6 @@ CSSParserImpl::CSSParserImpl()
mHashlessColorQuirk(false),
mUnitlessLengthQuirk(false),
mUnsafeRulesEnabled(false),
mIsChrome(false),
mViewportUnitsEnabled(true),
mHTMLMediaMode(false),
mParsingCompoundProperty(false),
@ -1491,7 +1484,6 @@ CSSParserImpl::ParseSheet(const nsAString& aInput,
}
mUnsafeRulesEnabled = aAllowUnsafeRules;
mIsChrome = nsContentUtils::IsSystemPrincipal(aSheetPrincipal);
mReusableSheets = aReusableSheets;
nsCSSToken* tk = &mToken;
@ -1516,7 +1508,6 @@ CSSParserImpl::ParseSheet(const nsAString& aInput,
ReleaseScanner();
mUnsafeRulesEnabled = false;
mIsChrome = false;
mReusableSheets = nullptr;
// XXX check for low level errors
@ -1693,7 +1684,10 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
// Check for unknown or preffed off properties
if (eCSSProperty_UNKNOWN == aPropID ||
!nsCSSProps::IsEnabled(aPropID, PropertyEnabledState())) {
!(nsCSSProps::IsEnabled(aPropID) ||
(mUnsafeRulesEnabled &&
nsCSSProps::PropHasFlags(aPropID,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS)))) {
NS_ConvertASCIItoUTF16 propName(nsCSSProps::GetStringValue(aPropID));
REPORT_UNEXPECTED_P(PEUnknownProperty, propName);
REPORT_UNEXPECTED(PEDeclDropped);
@ -2997,8 +2991,7 @@ CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
parseFunc = &CSSParserImpl::ParsePageRule;
newSection = eCSSSection_General;
} else if ((nsCSSProps::IsEnabled(eCSSPropertyAlias_MozAnimation,
PropertyEnabledState()) &&
} else if ((nsCSSProps::IsEnabled(eCSSPropertyAlias_MozAnimation) &&
mToken.mIdent.LowerCaseEqualsLiteral("-moz-keyframes")) ||
mToken.mIdent.LowerCaseEqualsLiteral("keyframes")) {
parseFunc = &CSSParserImpl::ParseKeyframesRule;

View File

@ -682,7 +682,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
@ -704,14 +704,14 @@ CSS_PROP_SHORTHAND(
border_block_end,
BorderBlockEnd,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.vertical-text.enabled")
CSS_PROP_SHORTHAND(
border-block-start,
border_block_start,
BorderBlockStart,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.vertical-text.enabled")
CSS_PROP_LOGICAL(
border-block-end-color,
@ -719,7 +719,7 @@ CSS_PROP_LOGICAL(
BorderBlockEndColor,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -736,7 +736,7 @@ CSS_PROP_LOGICAL(
BorderBlockEndStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -755,7 +755,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -772,7 +772,7 @@ CSS_PROP_LOGICAL(
BorderBlockStartColor,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -788,7 +788,7 @@ CSS_PROP_LOGICAL(
BorderBlockStartStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -806,7 +806,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -2171,7 +2171,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS,
"layout.css.vertical-text.enabled",
@ -2276,7 +2276,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -2296,7 +2296,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -2426,7 +2426,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
@ -2459,7 +2459,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS,
"layout.css.vertical-text.enabled",
@ -2505,7 +2505,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
@ -2524,7 +2524,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS,
"layout.css.vertical-text.enabled",
@ -2575,7 +2575,7 @@ CSS_PROP_POSITION(
object_fit,
ObjectFit,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.object-fit-and-position.enabled",
VARIANT_HK,
kObjectFitKTable,
@ -2587,7 +2587,7 @@ CSS_PROP_POSITION(
ObjectPosition,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.object-fit-and-position.enabled",
0,
kBackgroundPositionKTable,
@ -2600,7 +2600,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -2618,7 +2618,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -2635,7 +2635,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_END_EDGE,
"layout.css.vertical-text.enabled",
@ -2652,7 +2652,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL,
"layout.css.vertical-text.enabled",
VARIANT_AHLP | VARIANT_CALC,
@ -2752,7 +2752,7 @@ CSS_PROP_DISPLAY(
overflow_clip_box,
OverflowClipBox,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
"layout.css.overflow-clip-box.enabled",
VARIANT_HK,
@ -2801,7 +2801,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
CSS_PROPERTY_LOGICAL_END_EDGE,
@ -2823,7 +2823,7 @@ CSS_PROP_LOGICAL(
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
@ -3267,7 +3267,7 @@ CSS_PROP_VISIBILITY(
text_orientation,
TextOrientation,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.vertical-text.enabled",
VARIANT_HK,
kTextOrientationKTable,
@ -3590,14 +3590,11 @@ CSS_PROP_POSITION(
kWidthKTable,
offsetof(nsStylePosition, mWidth),
eStyleAnimType_Coord)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_USERINTERFACE(
-moz-window-dragging,
_moz_window_dragging,
CSS_PROP_DOMPROP_PREFIXED(WindowDragging),
CSS_PROPERTY_INTERNAL |
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME,
CSS_PROPERTY_PARSE_VALUE,
"",
VARIANT_HK,
kWindowDraggingKTable,
@ -3607,15 +3604,12 @@ CSS_PROP_UIRESET(
-moz-window-shadow,
_moz_window_shadow,
CSS_PROP_DOMPROP_PREFIXED(WindowShadow),
CSS_PROPERTY_INTERNAL |
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME,
CSS_PROPERTY_PARSE_VALUE,
"",
VARIANT_HK,
kWindowShadowKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
#endif
CSS_PROP_TEXT(
word-break,
word_break,
@ -3664,7 +3658,7 @@ CSS_PROP_VISIBILITY(
writing_mode,
WritingMode,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
"layout.css.vertical-text.enabled",
VARIANT_HK,
kWritingModeKTable,

View File

@ -28,35 +28,6 @@ using namespace mozilla;
typedef nsCSSProps::KTableValue KTableValue;
// MSVC before 2015 doesn't consider string literal as a constant
// expression, thus we are not able to do this check here.
#if !defined(_MSC_VER) || _MSC_VER >= 1900
// By wrapping internal-only properties in this macro, we are not
// exposing them in the CSSOM. Since currently it is not necessary to
// allow accessing them in that way, it is easier and cheaper to just
// do this rather than exposing them conditionally.
#define CSS_PROP(name_, id_, method_, flags_, pref_, ...) \
static_assert(!((flags_) & CSS_PROPERTY_ENABLED_MASK) || pref_[0], \
"Internal-only property '" #name_ "' should be wrapped in " \
"#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL");
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP
#endif
#define CSS_PROP(name_, id_, method_, flags_, pref_, ...) \
static_assert(!((flags_) & CSS_PROPERTY_ENABLED_IN_CHROME) || \
((flags_) & CSS_PROPERTY_ENABLED_IN_UA_SHEETS), \
"Property '" #name_ "' is enabled in chrome, so it should " \
"also be enabled in UA sheets");
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP
// required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it
extern const char* const kCSSRawProperties[];
@ -228,12 +199,11 @@ nsCSSProps::AddRefTable(void)
#ifdef DEBUG
{
// Assert that if CSS_PROPERTY_ENABLED_IN_UA_SHEETS or
// CSS_PROPERTY_ENABLED_IN_CHROME is used on a shorthand property
// that all of its component longhands also have the flag.
// Assert that if CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS is used
// on a shorthand property that all of its component longhands
// also has the flag.
static uint32_t flagsToCheck[] = {
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ENABLED_IN_CHROME
CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS
};
for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
shorthand < eCSSProperty_COUNT;
@ -249,7 +219,7 @@ nsCSSProps::AddRefTable(void)
++p) {
MOZ_ASSERT(nsCSSProps::PropHasFlags(*p, flag),
"all subproperties of a property with a "
"CSS_PROPERTY_ENABLED_* flag must also have "
"CSS_PROPERTY_ALWAYS_ENABLED_* flag must also have "
"the flag");
}
}
@ -523,7 +493,7 @@ nsCSSProps::LookupProperty(const nsACString& aProperty,
}
MOZ_ASSERT(eCSSAliasCount != 0,
"'res' must be an alias at this point so we better have some!");
// We intentionally don't support eEnabledInUASheets or eEnabledInChrome
// We intentionally don't support eEnabledInUASheets or eEnabledInChromeOrCertifiedApp
// for aliases yet because it's unlikely there will be a need for it.
if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) {
res = gAliases[res - eCSSProperty_COUNT];
@ -557,8 +527,8 @@ nsCSSProps::LookupProperty(const nsAString& aProperty, EnabledState aEnabled)
}
MOZ_ASSERT(eCSSAliasCount != 0,
"'res' must be an alias at this point so we better have some!");
// We intentionally don't support eEnabledInUASheets or eEnabledInChrome
// for aliases yet because it's unlikely there will be a need for it.
// We intentionally don't support eEnabledInUASheets for aliases yet
// because it's unlikely there will be a need for it.
if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) {
res = gAliases[res - eCSSProperty_COUNT];
MOZ_ASSERT(0 <= res && res < eCSSProperty_COUNT,
@ -2984,24 +2954,16 @@ nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = {
/* 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))
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
IS_ENABLED_BY_DEFAULT(flags_),
true,
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
IS_ENABLED_BY_DEFAULT(flags_),
true,
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
@ -3009,8 +2971,6 @@ nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
true,
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS
#undef IS_ENABLED_BY_DEFAULT
};
#include "../../dom/base/PropertyUseCounterMap.inc"

View File

@ -200,23 +200,14 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// This property requires a stacking context.
#define CSS_PROPERTY_CREATES_STACKING_CONTEXT (1<<21)
// 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.
#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 is always enabled in UA sheets. This is meant to be used
// together with a pref that enables the property for non-UA sheets.
// Note that if such a property has an alias, then any use of that alias
// in an UA sheet will still be ignored unless the pref is enabled.
// In other words, this bit has no effect on the use of aliases.
#define CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS (1<<22)
// XXX (1<<23) will shortly be reused in bug 1069192.
// This property's unitless values are pixels.
#define CSS_PROPERTY_NUMBERS_ARE_PIXELS (1<<24)
@ -307,8 +298,6 @@ public:
eEnabledForAllContent = 0,
// Enable a property in UA sheets.
eEnabledInUASheets = 0x01,
// Enable a property in chrome code.
eEnabledInChrome = 0x02,
// Special value to unconditionally enable a property. This implies all the
// bits above, but is strictly more than just their OR-ed union.
// This just skips any test so a property will be enabled even if it would
@ -554,12 +543,15 @@ public:
return kIDLNameSortPositionTable[aProperty];
}
public:
static bool IsEnabled(nsCSSProperty aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_with_aliases,
"out of range");
return gPropertyEnabled[aProperty];
}
private:
// A table for the use counter associated with each CSS property. If a
// property does not have a use counter defined in UseCounters.conf, then
// its associated entry is |eUseCounter_UNKNOWN|.
@ -582,12 +574,7 @@ public:
return true;
}
if ((aEnabled & eEnabledInUASheets) &&
PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_UA_SHEETS))
{
return true;
}
if ((aEnabled & eEnabledInChrome) &&
PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_CHROME))
PropHasFlags(aProperty, CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS))
{
return true;
}

View File

@ -96,8 +96,7 @@ struct nsComputedStyleMap
bool IsEnabled() const
{
return nsCSSProps::IsEnabled(mProperty,
nsCSSProps::eEnabledForAllContent);
return nsCSSProps::IsEnabled(mProperty);
}
};

View File

@ -432,3 +432,11 @@ nsDOMCSSDeclaration::RemoveCustomProperty(const nsAString& aPropertyName)
CSS_CUSTOM_NAME_PREFIX_LENGTH));
return SetCSSDeclaration(decl);
}
bool IsCSSPropertyExposedToJS(nsCSSProperty aProperty, JSContext* cx, JSObject* obj)
{
MOZ_ASSERT_UNREACHABLE("This is currently not used anywhere, "
"but should be reused soon in bug 1069192");
nsCSSProps::EnabledState enabledState = nsCSSProps::eEnabledForAllContent;
return nsCSSProps::IsEnabled(aProperty, enabledState);
}

View File

@ -174,4 +174,12 @@ protected:
virtual ~nsDOMCSSDeclaration();
};
bool IsCSSPropertyExposedToJS(nsCSSProperty aProperty, JSContext* cx, JSObject* obj);
template <nsCSSProperty Property>
MOZ_ALWAYS_INLINE bool IsCSSPropertyExposedToJS(JSContext* cx, JSObject* obj)
{
return IsCSSPropertyExposedToJS(Property, cx, obj);
}
#endif // nsDOMCSSDeclaration_h___

View File

@ -111,9 +111,7 @@ const char *gInaccessibleProperties[] = {
"-moz-script-size-multiplier",
"-moz-script-min-size",
"-moz-math-variant",
"-moz-math-display", // parsed by UA sheets only
"-moz-window-dragging", // chrome-only internal properties
"-moz-window-shadow" // chrome-only internal properties
"-moz-math-display" // parsed by UA sheets only
};
inline int

View File

@ -1841,6 +1841,22 @@ var gCSSProperties = {
other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ],
invalid_values: []
},
"-moz-window-dragging": {
domProp: "MozWindowDragging",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "no-drag" ],
other_values: [ "drag" ],
invalid_values: [ "none" ]
},
"-moz-window-shadow": {
domProp: "MozWindowShadow",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "default" ],
other_values: [ "none", "menu", "tooltip", "sheet" ],
invalid_values: []
},
"background": {
domProp: "background",
inherited: false,
@ -6605,24 +6621,3 @@ if (IsCSSPropertyPrefEnabled("layout.css.unset-value.enabled")) {
gCSSProperties["text-align"].invalid_values.push("true left");
}
}
if (false) {
// TODO These properties are chrome-only, and are not exposed via CSSOM.
// We may still want to find a way to test them. See bug 1206999.
gCSSProperties["-moz-window-dragging"] = {
//domProp: "MozWindowDragging",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "no-drag" ],
other_values: [ "drag" ],
invalid_values: [ "none" ]
};
gCSSProperties["-moz-window-shadow"] = {
//domProp: "MozWindowShadow",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "default" ],
other_values: [ "none", "menu", "tooltip", "sheet" ],
invalid_values: []
};
}