Bug 1269975 part 2 - Rename nsCSSParser::PropertyEnabledState() to EnabledState(). r=heycam
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 10 May 2016 18:44:05 +1000
changeset 296746 7754dd0b76b008f5164a3f8cf6bba6cb36e794c3
parent 296745 b2b5e29468766c10fde0f7653cf7a49aeece567e
child 296747 d0769e80038115a28d497bcdc1166ae216f46747
push id76467
push userxquan@mozilla.com
push dateTue, 10 May 2016 08:51:33 +0000
treeherdermozilla-inbound@7fa52daaae36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1269975
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1269975 part 2 - Rename nsCSSParser::PropertyEnabledState() to EnabledState(). r=heycam MozReview-Commit-ID: 4JESxsOYN4w
layout/style/nsCSSParser.cpp
--- 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::eForAllContent) == 0,
                   "CSSEnabledState::eForAllContent should be zero for "
                   "this bitfield to work");
     CSSEnabledState enabledState = CSSEnabledState::eForAllContent;
     if (AgentRulesEnabled()) {
       enabledState |= CSSEnabledState::eInUASheets;
     }
     if (mIsChrome) {
       enabledState |= CSSEnabledState::eInChrome;
     }
     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")) {
@@ -7373,18 +7373,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;
 }
 
@@ -11380,18 +11379,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).