Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: Source/core/css/CSSParser.cpp

Issue 14987004: Switching CSS Variables over to RuntimeEnabledFeatures (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/CSSParserMode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 83af384ce1002c1f1ba2298668e516ae420ccffd..c950ae1351ffdb135271bd103e7c3e1b88251fa9 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -244,7 +244,6 @@ CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL)
, isCSSCustomFilterEnabled(false)
, isCSSStickyPositionEnabled(false)
, isCSSGridLayoutEnabled(false)
- , isCSSVariablesEnabled(false)
, needsSiteSpecificQuirks(false)
{
}
@@ -257,7 +256,6 @@ CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
, isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCSSCustomFilterEnabled() : false)
, isCSSStickyPositionEnabled(document->cssStickyPositionEnabled())
, isCSSGridLayoutEnabled(document->cssGridLayoutEnabled())
- , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVariablesEnabled() : false)
, needsSiteSpecificQuirks(document->settings() ? document->settings()->needsSiteSpecificQuirks() : false)
{
}
@@ -271,7 +269,6 @@ bool operator==(const CSSParserContext& a, const CSSParserContext& b)
&& a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled
&& a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled
&& a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled
- && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled
&& a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks;
}
@@ -3112,11 +3109,6 @@ bool CSSParser::parseFillShorthand(CSSPropertyID propId, const CSSPropertyID* pr
return true;
}
-bool CSSParser::cssVariablesEnabled() const
-{
- return m_context.isCSSVariablesEnabled;
-}
-
void CSSParser::storeVariableDeclaration(const CSSParserString& name, PassOwnPtr<CSSParserValueList> value, bool important)
{
// When CSSGrammar.y encounters an invalid declaration it passes null for the CSSParserValueList, just bail.
@@ -10027,7 +10019,7 @@ inline void CSSParser::detectDashToken(int length)
m_token = MINFUNCTION;
else if (isASCIIAlphaCaselessEqual(name[10], 'x') && isEqualToCSSIdentifier(name + 1, "webkit-ma"))
m_token = MAXFUNCTION;
- else if (cssVariablesEnabled() && isASCIIAlphaCaselessEqual(name[10], 'r') && isEqualToCSSIdentifier(name + 1, "webkit-va"))
+ else if (RuntimeEnabledFeatures::cssVariablesEnabled() && isASCIIAlphaCaselessEqual(name[10], 'r') && isEqualToCSSIdentifier(name + 1, "webkit-va"))
m_token = VARFUNCTION;
} else if (length == 12 && isEqualToCSSIdentifier(name + 1, "webkit-calc"))
m_token = CALCFUNCTION;
@@ -10462,7 +10454,7 @@ restartAfterComment:
parseIdentifier(result, resultString, hasEscape);
m_token = IDENT;
- if (cssVariablesEnabled() && isEqualToCSSIdentifier(tokenStart<SrcCharacterType>() + 1, "webkit-var") && tokenStart<SrcCharacterType>()[11] == '-' && isIdentifierStartAfterDash(tokenStart<SrcCharacterType>() + 12))
+ if (RuntimeEnabledFeatures::cssVariablesEnabled() && isEqualToCSSIdentifier(tokenStart<SrcCharacterType>() + 1, "webkit-var") && tokenStart<SrcCharacterType>()[11] == '-' && isIdentifierStartAfterDash(tokenStart<SrcCharacterType>() + 12))
m_token = VAR_DEFINITION;
else if (*currentCharacter<SrcCharacterType>() == '(') {
m_token = FUNCTION;
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/CSSParserMode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698