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

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

Issue 2889153006: Refactored out need to pass property to ConsumeBackgroundSize parsing (Closed)
Patch Set: 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..7ab7c3281a91699ac960e8a83c99b2bafd1ffaf0 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1011,9 +1011,9 @@ static CSSValue* ConsumePrefixedBackgroundBox(CSSPropertyID property,
return nullptr;
}
-static CSSValue* ConsumeBackgroundSize(CSSPropertyID unresolved_property,
- CSSParserTokenRange& range,
- CSSParserMode css_parser_mode) {
+static CSSValue* ConsumeBackgroundSize(CSSParserTokenRange& range,
+ CSSParserMode css_parser_mode,
+ bool use_legacy_parsing) {
if (IdentMatches<CSSValueContain, CSSValueCover>(range.Peek().Id()))
return ConsumeIdent(range);
@@ -1029,7 +1029,7 @@ static CSSValue* ConsumeBackgroundSize(CSSPropertyID unresolved_property,
else
vertical = ConsumeLengthOrPercent(range, css_parser_mode, kValueRangeAll,
UnitlessQuirk::kForbid);
- } else if (unresolved_property == CSSPropertyAliasWebkitBackgroundSize) {
+ } else if (use_legacy_parsing) {
// Legacy syntax: "-webkit-background-size: 10px" is equivalent to
// "background-size: 10px 10px".
vertical = horizontal;
@@ -1075,9 +1075,12 @@ static CSSValue* ConsumeBackgroundComponent(CSSPropertyID unresolved_property,
CSSValueBottom>(
range, context->Mode());
case CSSPropertyBackgroundSize:
- case CSSPropertyAliasWebkitBackgroundSize:
case CSSPropertyWebkitMaskSize:
- return ConsumeBackgroundSize(unresolved_property, range, context->Mode());
+ return ConsumeBackgroundSize(range, context->Mode(),
+ false /* use_legacy_parsing */);
+ case CSSPropertyAliasWebkitBackgroundSize:
+ return ConsumeBackgroundSize(range, context->Mode(),
+ true /* use_legacy_parsing */);
case CSSPropertyBackgroundColor:
return ConsumeColor(range, context->Mode());
default:
@@ -2698,7 +2701,8 @@ bool CSSPropertyParser::ConsumeBackgroundShorthand(
property == CSSPropertyWebkitMaskSize) {
if (!ConsumeSlashIncludingWhitespace(range_))
continue;
- value = ConsumeBackgroundSize(property, range_, context_->Mode());
+ value = ConsumeBackgroundSize(range_, context_->Mode(),
+ false /* use_legacy_parsing */);
if (!value ||
!parsed_longhand[i - 1]) // Position must have been
// parsed in the current layer.
« 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