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

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

Issue 14178009: Remove CSS_REGIONS compile flag from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use RuntimeEnabledFeatures::cssRegionsEnabled all over the places. Guard WEBKIT_REGION_RULE at runt… Created 7 years, 8 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
Index: Source/core/css/CSSParser.cpp
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
index 6e82eb085957a8461fbd244cdca13925f97cec6c..2cf7ab0a37820ee24a442ac30cc4709579911bae 100644
--- a/Source/core/css/CSSParser.cpp
+++ b/Source/core/css/CSSParser.cpp
@@ -247,7 +247,6 @@ CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL)
, isHTMLDocument(false)
, isCSSCustomFilterEnabled(false)
, isCSSStickyPositionEnabled(false)
- , isCSSRegionsEnabled(false)
, isCSSCompositingEnabled(false)
, isCSSGridLayoutEnabled(false)
, isCSSVariablesEnabled(false)
@@ -262,7 +261,6 @@ CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
, isHTMLDocument(document->isHTMLDocument())
, isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCSSCustomFilterEnabled() : false)
, isCSSStickyPositionEnabled(document->cssStickyPositionEnabled())
- , isCSSRegionsEnabled(document->cssRegionsEnabled())
, isCSSCompositingEnabled(document->cssCompositingEnabled())
, isCSSGridLayoutEnabled(document->cssGridLayoutEnabled())
, isCSSVariablesEnabled(document->settings() ? document->settings()->cssVariablesEnabled() : false)
@@ -278,7 +276,6 @@ bool operator==(const CSSParserContext& a, const CSSParserContext& b)
&& a.isHTMLDocument == b.isHTMLDocument
&& a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled
&& a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled
- && a.isCSSRegionsEnabled == b.isCSSRegionsEnabled
&& a.isCSSCompositingEnabled == b.isCSSCompositingEnabled
&& a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled
&& a.isCSSVariablesEnabled == b.isCSSVariablesEnabled
@@ -922,21 +919,19 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
if (valueID == CSSValueExact || valueID == CSSValueEconomy)
return true;
break;
-#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitRegionBreakAfter:
case CSSPropertyWebkitRegionBreakBefore:
- if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || valueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSValueLeft || valueID == CSSValueRight))
+ if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueAuto || valueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSValueLeft || valueID == CSSValueRight))
return true;
break;
case CSSPropertyWebkitRegionBreakInside:
- if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || valueID == CSSValueAvoid))
+ if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueAuto || valueID == CSSValueAvoid))
return true;
break;
case CSSPropertyWebkitRegionOverflow:
- if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || valueID == CSSValueBreak))
+ if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueAuto || valueID == CSSValueBreak))
return true;
break;
-#endif
case CSSPropertyWebkitRtlOrdering:
if (valueID == CSSValueLogical || valueID == CSSValueVisual)
return true;
@@ -1101,12 +1096,10 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyWebkitOverflowScrolling:
#endif
case CSSPropertyWebkitPrintColorAdjust:
-#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitRegionBreakAfter:
case CSSPropertyWebkitRegionBreakBefore:
case CSSPropertyWebkitRegionBreakInside:
case CSSPropertyWebkitRegionOverflow:
-#endif
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitRubyPosition:
#if ENABLE(CSS3_TEXT)
@@ -2434,16 +2427,14 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
else
validPrimitive = validUnit(value, FTime | FInteger | FNonNeg);
break;
-#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitFlowInto:
- if (!cssRegionsEnabled())
+ if (!RuntimeEnabledFeatures::cssRegionsEnabled())
return false;
return parseFlowThread(propId, important);
case CSSPropertyWebkitFlowFrom:
- if (!cssRegionsEnabled())
+ if (!RuntimeEnabledFeatures::cssRegionsEnabled())
return false;
return parseRegionThread(propId, important);
-#endif
case CSSPropertyWebkitTransform:
if (id == CSSValueNone)
validPrimitive = true;
@@ -2925,12 +2916,10 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyWebkitOverflowScrolling:
#endif
case CSSPropertyWebkitPrintColorAdjust:
-#if ENABLE(CSS_REGIONS)
case CSSPropertyWebkitRegionBreakAfter:
case CSSPropertyWebkitRegionBreakBefore:
case CSSPropertyWebkitRegionBreakInside:
case CSSPropertyWebkitRegionOverflow:
-#endif
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitRubyPosition:
#if ENABLE(CSS3_TEXT)
@@ -8686,7 +8675,6 @@ PassRefPtr<CSSValueList> CSSParser::parseFilter()
return list.release();
}
-#if ENABLE(CSS_REGIONS)
static bool validFlowName(const String& flowName)
{
return !(equalIgnoringCase(flowName, "auto")
@@ -8695,12 +8683,6 @@ static bool validFlowName(const String& flowName)
|| equalIgnoringCase(flowName, "initial")
|| equalIgnoringCase(flowName, "none"));
}
-#endif
-
-bool CSSParser::cssRegionsEnabled() const
-{
- return m_context.isCSSRegionsEnabled;
-}
bool CSSParser::cssCompositingEnabled() const
{
@@ -8712,7 +8694,6 @@ bool CSSParser::cssGridLayoutEnabled() const
return m_context.isCSSGridLayoutEnabled;
}
-#if ENABLE(CSS_REGIONS)
bool CSSParser::parseFlowThread(const String& flowName)
{
setupParser("@-internal-decls{-webkit-flow-into:", flowName, "}");
@@ -8727,7 +8708,7 @@ bool CSSParser::parseFlowThread(const String& flowName)
bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important)
{
ASSERT(propId == CSSPropertyWebkitFlowInto);
- ASSERT(cssRegionsEnabled());
+ ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
if (m_valueList->size() != 1)
return false;
@@ -8759,7 +8740,7 @@ bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important)
bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important)
{
ASSERT(propId == CSSPropertyWebkitFlowFrom);
- ASSERT(cssRegionsEnabled());
+ ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
if (m_valueList->size() != 1)
return false;
@@ -8785,7 +8766,6 @@ bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important)
return true;
}
-#endif
bool CSSParser::parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
{
@@ -10246,12 +10226,11 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape)
return;
}
-#if ENABLE(CSS_REGIONS)
if (isASCIIAlphaCaselessEqual(name[14], 'n') && isEqualToCSSIdentifier(name + 2, "webkit-regio")) {
m_token = WEBKIT_REGION_RULE_SYM;
return;
}
-#endif
+
if (isASCIIAlphaCaselessEqual(name[14], 'r') && isEqualToCSSIdentifier(name + 2, "webkit-filte")) {
m_token = WEBKIT_FILTER_RULE_SYM;
return;
@@ -11216,7 +11195,7 @@ void CSSParser::setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector>
StyleRuleBase* CSSParser::createRegionRule(Vector<OwnPtr<CSSParserSelector> >* regionSelector, RuleList* rules)
{
- if (!cssRegionsEnabled() || !regionSelector || !rules) {
+ if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !regionSelector || !rules) {
endRuleBody(true);
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698