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

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

Issue 2849363002: Refactored out property specific logic in animation list parsing. (Closed)
Patch Set: Fixed crashing layout tests 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 | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | 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 2055a28b17eebcd663c871d9a06cd7f5f19a75b4..98627479f0720fd30dcf34e69080f78b26a4475e 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -501,26 +501,6 @@ static bool IsValidAnimationPropertyList(const CSSValueList& value_list) {
return true;
}
-static CSSValueList* ConsumeAnimationPropertyList(
- CSSPropertyID property,
- CSSParserTokenRange& range,
- const CSSParserContext* context,
- bool use_legacy_parsing) {
- CSSValueList* list = CSSValueList::CreateCommaSeparated();
- do {
- CSSValue* value =
- ConsumeAnimationValue(property, range, context, use_legacy_parsing);
- if (!value)
- return nullptr;
- list->Append(*value);
- } while (ConsumeCommaIncludingWhitespace(range));
- if (property == CSSPropertyTransitionProperty &&
- !IsValidAnimationPropertyList(*list))
- return nullptr;
- DCHECK(list->length());
- return list;
-}
-
bool CSSPropertyParser::ConsumeAnimationShorthand(
const StylePropertyShorthand& shorthand,
bool use_legacy_parsing,
@@ -1691,19 +1671,40 @@ const CSSValue* CSSPropertyParser::ParseSingleValue(
return ConsumeLocale(range_);
case CSSPropertyAnimationDelay:
case CSSPropertyTransitionDelay:
+ return ConsumeCommaSeparatedList(ConsumeTime, range_, kValueRangeAll);
case CSSPropertyAnimationDirection:
+ return ConsumeCommaSeparatedList(
+ ConsumeIdent<CSSValueNormal, CSSValueAlternate, CSSValueReverse,
+ CSSValueAlternateReverse>,
+ range_);
case CSSPropertyAnimationDuration:
case CSSPropertyTransitionDuration:
+ return ConsumeCommaSeparatedList(ConsumeTime, range_,
+ kValueRangeNonNegative);
case CSSPropertyAnimationFillMode:
+ return ConsumeCommaSeparatedList(
+ ConsumeIdent<CSSValueNone, CSSValueForwards, CSSValueBackwards,
+ CSSValueBoth>,
+ range_);
case CSSPropertyAnimationIterationCount:
+ return ConsumeCommaSeparatedList(ConsumeAnimationIterationCount, range_);
case CSSPropertyAnimationName:
+ return ConsumeCommaSeparatedList(
+ ConsumeAnimationName, range_, context_,
+ unresolved_property == CSSPropertyAliasWebkitAnimationName);
case CSSPropertyAnimationPlayState:
- case CSSPropertyTransitionProperty:
+ return ConsumeCommaSeparatedList(
+ ConsumeIdent<CSSValueRunning, CSSValuePaused>, range_);
+ case CSSPropertyTransitionProperty: {
+ CSSValueList* list =
+ ConsumeCommaSeparatedList(ConsumeTransitionProperty, range_);
+ if (!list || !IsValidAnimationPropertyList(*list))
+ return nullptr;
+ return list;
+ }
case CSSPropertyAnimationTimingFunction:
case CSSPropertyTransitionTimingFunction:
- return ConsumeAnimationPropertyList(
- property, range_, context_,
- unresolved_property == CSSPropertyAliasWebkitAnimationName);
+ return ConsumeCommaSeparatedList(ConsumeAnimationTimingFunction, range_);
case CSSPropertyGridColumnGap:
case CSSPropertyGridRowGap:
return ConsumeLengthOrPercent(range_, context_->Mode(),
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698