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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 2796803002: Refactored out the need to use CSSPropertyID to parse shadow properties. (Closed)
Patch Set: converted double bool arguments to single bool argument Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 49f2fb29c4974ed4ab86b8efb3accf7c3d51c825..761d74800363d9741041b36a5f3eb9fea63dc53f 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -552,15 +552,14 @@ bool CSSPropertyParser::consumeAnimationShorthand(
static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range,
CSSParserMode cssParserMode,
- bool allowInset,
- bool allowSpread) {
+ bool allowInsetAndSpread) {
CSSIdentifierValue* style = nullptr;
CSSValue* color = nullptr;
if (range.atEnd())
return nullptr;
if (range.peek().id() == CSSValueInset) {
- if (!allowInset)
+ if (!allowInsetAndSpread)
return nullptr;
style = consumeIdent(range);
}
@@ -583,7 +582,7 @@ static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range,
// Blur radius must be non-negative.
if (blurRadius->getDoubleValue() < 0)
return nullptr;
- if (allowSpread)
+ if (allowInsetAndSpread)
spreadDistance = consumeLength(range, cssParserMode, ValueRangeAll);
}
@@ -591,7 +590,7 @@ static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range,
if (!color)
color = consumeColor(range, cssParserMode);
if (range.peek().id() == CSSValueInset) {
- if (!allowInset || style)
+ if (!allowInsetAndSpread || style)
return nullptr;
style = consumeIdent(range);
}
@@ -602,14 +601,14 @@ static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range,
static CSSValue* consumeShadow(CSSParserTokenRange& range,
CSSParserMode cssParserMode,
- bool isBoxShadowProperty) {
+ bool allowInsetAndSpread) {
if (range.peek().id() == CSSValueNone)
return consumeIdent(range);
CSSValueList* shadowValueList = CSSValueList::createCommaSeparated();
do {
- if (CSSShadowValue* shadowValue = parseSingleShadow(
- range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty))
+ if (CSSShadowValue* shadowValue =
+ parseSingleShadow(range, cssParserMode, allowInsetAndSpread))
shadowValueList->append(*shadowValue);
else
return nullptr;
@@ -628,7 +627,7 @@ static CSSFunctionValue* consumeFilterFunction(
CSSValue* parsedValue = nullptr;
if (filterType == CSSValueDropShadow) {
- parsedValue = parseSingleShadow(args, context->mode(), false, false);
+ parsedValue = parseSingleShadow(args, context->mode(), false);
} else {
if (args.atEnd()) {
context->count(UseCounter::CSSFilterFunctionNoArguments);
@@ -1926,9 +1925,9 @@ const CSSValue* CSSPropertyParser::parseSingleValue(
return consumeBorderWidth(m_range, m_context->mode(), unitless);
}
case CSSPropertyTextShadow:
+ return consumeShadow(m_range, m_context->mode(), false);
case CSSPropertyBoxShadow:
- return consumeShadow(m_range, m_context->mode(),
- property == CSSPropertyBoxShadow);
+ return consumeShadow(m_range, m_context->mode(), true);
case CSSPropertyFilter:
case CSSPropertyBackdropFilter:
return consumeFilter(m_range, m_context);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698