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

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

Issue 2895873002: Refactored out need to pass property id to ConsumePrefixedBackgroundBox (Closed)
Patch Set: addressed review Created 3 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 | « 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 e29b3bc6b9d72f12275fb08782efe52e328bda78..70448ad1a0c48510c9044079a0bc335a3d2c9639 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -996,17 +996,15 @@ static CSSValue* ConsumeMaskSourceType(CSSParserTokenRange& range) {
return ConsumeIdent<CSSValueAuto, CSSValueAlpha, CSSValueLuminance>(range);
}
-static CSSValue* ConsumePrefixedBackgroundBox(CSSPropertyID property,
- CSSParserTokenRange& range,
- const CSSParserContext* context) {
+static CSSValue* ConsumePrefixedBackgroundBox(CSSParserTokenRange& range,
+ const CSSParserContext* context,
+ bool allow_text_value) {
// The values 'border', 'padding' and 'content' are deprecated and do not
// apply to the version of the property that has the -webkit- prefix removed.
if (CSSValue* value =
ConsumeIdentRange(range, CSSValueBorder, CSSValuePaddingBox))
return value;
- if ((property == CSSPropertyWebkitBackgroundClip ||
- property == CSSPropertyWebkitMaskClip) &&
- range.Peek().Id() == CSSValueText)
+ if (allow_text_value && range.Peek().Id() == CSSValueText)
return ConsumeIdent(range);
return nullptr;
}
@@ -1057,10 +1055,13 @@ static CSSValue* ConsumeBackgroundComponent(CSSPropertyID unresolved_property,
case CSSPropertyMaskSourceType:
return ConsumeMaskSourceType(range);
case CSSPropertyWebkitBackgroundClip:
- case CSSPropertyWebkitBackgroundOrigin:
case CSSPropertyWebkitMaskClip:
+ return ConsumePrefixedBackgroundBox(range, context,
+ true /* allow_text_value */);
+ case CSSPropertyWebkitBackgroundOrigin:
case CSSPropertyWebkitMaskOrigin:
- return ConsumePrefixedBackgroundBox(unresolved_property, range, context);
+ return ConsumePrefixedBackgroundBox(range, context,
+ false /* allow_text_value */);
case CSSPropertyBackgroundImage:
case CSSPropertyWebkitMaskImage:
return ConsumeImageOrNone(range, 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