--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -351,32 +351,32 @@ public:
bool ChromeRulesEnabled() const {
return mIsChrome;
}
bool UserRulesEnabled() const {
return mParsingMode == css::eAgentSheetFeatures ||
mParsingMode == css::eUserSheetFeatures;
}
- CSSEnabledState PropertyEnabledState() const {
+ CSSEnabledState EnabledState() const {
static_assert(int(CSSEnabledState::eAllContent) == 0,
"CSSEnabledState::eAllContent should be zero for "
"this bitfield to work");
CSSEnabledState enabledState = CSSEnabledState::eAllContent;
if (AgentRulesEnabled()) {
enabledState |= CSSEnabledState::eUASheets;
}
if (mIsChrome) {
enabledState |= CSSEnabledState::eChrome;
}
return enabledState;
}
nsCSSProperty LookupEnabledProperty(const nsAString& aProperty) {
- return nsCSSProps::LookupProperty(aProperty, PropertyEnabledState());
+ return nsCSSProps::LookupProperty(aProperty, EnabledState());
}
protected:
class nsAutoParseCompoundProperty;
friend class nsAutoParseCompoundProperty;
class nsAutoFailingSupportsRule;
friend class nsAutoFailingSupportsRule;
@@ -1900,17 +1900,17 @@ CSSParserImpl::ParseTransformProperty(co
if (parsedOK && GetToken(true)) {
parsedOK = false;
}
bool changed = false;
if (parsedOK) {
declaration->ExpandTo(&mData);
changed = mData.TransferFromBlock(mTempData, eCSSProperty_transform,
- PropertyEnabledState(), false,
+ EnabledState(), false,
true, false, declaration,
GetDocument());
declaration->CompressFrom(&mData);
}
if (changed) {
aValue = *declaration->GetNormalBlock()->ValueFor(eCSSProperty_transform);
} else {
@@ -1947,17 +1947,17 @@ CSSParserImpl::ParseProperty(const nsCSS
InitScanner(scanner, reporter, aSheetURI, aBaseURI, aSheetPrincipal);
mSection = eCSSSection_General;
scanner.SetSVGMode(aIsSVGMode);
*aChanged = false;
// Check for unknown or preffed off properties
if (eCSSProperty_UNKNOWN == aPropID ||
- !nsCSSProps::IsEnabled(aPropID, PropertyEnabledState())) {
+ !nsCSSProps::IsEnabled(aPropID, EnabledState())) {
NS_ConvertASCIItoUTF16 propName(nsCSSProps::GetStringValue(aPropID));
REPORT_UNEXPECTED_P(PEUnknownProperty, propName);
REPORT_UNEXPECTED(PEDeclDropped);
OUTPUT_ERROR();
ReleaseScanner();
return;
}
@@ -1982,17 +1982,17 @@ CSSParserImpl::ParseProperty(const nsCSS
// same importance level, then we can just copy our parsed value
// directly into the declaration without going through the whole
// expand/compress thing.
if (!aDeclaration->TryReplaceValue(aPropID, aIsImportant, mTempData,
aChanged)) {
// Do it the slow way
aDeclaration->ExpandTo(&mData);
*aChanged = mData.TransferFromBlock(mTempData, aPropID,
- PropertyEnabledState(), aIsImportant,
+ EnabledState(), aIsImportant,
true, false, aDeclaration,
GetDocument());
aDeclaration->CompressFrom(&mData);
}
CLEAR_ERROR();
}
mTempData.AssertInitialState();
@@ -3257,17 +3257,17 @@ CSSParserImpl::ParseAtRule(RuleAppendFun
parseFunc = &CSSParserImpl::ParseFontFeatureValuesRule;
newSection = eCSSSection_General;
} else if (mToken.mIdent.LowerCaseEqualsLiteral("page")) {
parseFunc = &CSSParserImpl::ParsePageRule;
newSection = eCSSSection_General;
} else if ((nsCSSProps::IsEnabled(eCSSPropertyAlias_MozAnimation,
- PropertyEnabledState()) &&
+ EnabledState()) &&
mToken.mIdent.LowerCaseEqualsLiteral("-moz-keyframes")) ||
(nsCSSProps::IsEnabled(eCSSPropertyAlias_WebkitAnimation) &&
mToken.mIdent.LowerCaseEqualsLiteral("-webkit-keyframes")) ||
mToken.mIdent.LowerCaseEqualsLiteral("keyframes")) {
parseFunc = &CSSParserImpl::ParseKeyframesRule;
newSection = eCSSSection_General;
} else if (mToken.mIdent.LowerCaseEqualsLiteral("supports")) {
@@ -7359,18 +7359,17 @@ CSSParserImpl::ParseDeclaration(css::Dec
if (customProperty) {
MOZ_ASSERT(Substring(propertyName, 0,
CSS_CUSTOM_NAME_PREFIX_LENGTH).EqualsLiteral("--"));
// remove '--'
nsDependentString varName(propertyName, CSS_CUSTOM_NAME_PREFIX_LENGTH);
aDeclaration->AddVariableDeclaration(varName, variableType, variableValue,
status == ePriority_Important, false);
} else {
- *aChanged |= mData.TransferFromBlock(mTempData, propID,
- PropertyEnabledState(),
+ *aChanged |= mData.TransferFromBlock(mTempData, propID, EnabledState(),
status == ePriority_Important,
false, aMustCallValueAppended,
aDeclaration, GetDocument());
}
return true;
}
@@ -11366,18 +11365,17 @@ CSSParserImpl::ParseProperty(nsCSSProper
propertyValue.Truncate(propertyValue.Length() - 1);
}
}
if (!mInSupportsCondition) {
if (nsCSSProps::IsShorthand(aPropID)) {
// If this is a shorthand property, we store the token stream on each
// of its corresponding longhand properties.
- CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID,
- PropertyEnabledState()) {
+ CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID, EnabledState()) {
nsCSSValueTokenStream* tokenStream = new nsCSSValueTokenStream;
tokenStream->mPropertyID = *p;
tokenStream->mShorthandPropertyID = aPropID;
tokenStream->mTokenStream = propertyValue;
tokenStream->mBaseURI = mBaseURI;
tokenStream->mSheetURI = mSheetURI;
tokenStream->mSheetPrincipal = mSheetPrincipal;
// XXX Should store sheet here (see bug 952338).