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

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

Issue 2896543002: Implements CSSPropertyAPI for the animation-name property. (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
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..b98b10c28ecf54f0c8b56c249ceccbb811357c79 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -41,6 +41,7 @@
#include "core/css/parser/FontVariantNumericParser.h"
#include "core/css/properties/CSSPropertyAPI.h"
#include "core/css/properties/CSSPropertyAlignmentUtils.h"
+#include "core/css/properties/CSSPropertyAnimationNameUtils.h"
#include "core/css/properties/CSSPropertyColumnUtils.h"
#include "core/css/properties/CSSPropertyDescriptor.h"
#include "core/css/properties/CSSPropertyFontUtils.h"
@@ -330,25 +331,6 @@ static CSSValue* ConsumeAnimationIterationCount(CSSParserTokenRange& range) {
return ConsumeNumber(range, kValueRangeNonNegative);
}
-static CSSValue* ConsumeAnimationName(CSSParserTokenRange& range,
- const CSSParserContext* context,
- bool allow_quoted_name) {
- if (range.Peek().Id() == CSSValueNone)
- return ConsumeIdent(range);
-
- if (allow_quoted_name && range.Peek().GetType() == kStringToken) {
- // Legacy support for strings in prefixed animations.
- context->Count(UseCounter::kQuotedAnimationName);
-
- const CSSParserToken& token = range.ConsumeIncludingWhitespace();
- if (EqualIgnoringASCIICase(token.Value(), "none"))
- return CSSIdentifierValue::Create(CSSValueNone);
- return CSSCustomIdentValue::Create(token.Value().ToAtomicString());
- }
-
- return ConsumeCustomIdent(range);
-}
-
static CSSValue* ConsumeTransitionProperty(CSSParserTokenRange& range) {
const CSSParserToken& token = range.Peek();
if (token.GetType() != kIdentToken)
@@ -478,7 +460,8 @@ static CSSValue* ConsumeAnimationValue(CSSPropertyID property,
case CSSPropertyAnimationIterationCount:
return ConsumeAnimationIterationCount(range);
case CSSPropertyAnimationName:
- return ConsumeAnimationName(range, context, use_legacy_parsing);
+ return CSSPropertyAnimationNameUtils::ConsumeAnimationName(
+ range, context, use_legacy_parsing);
case CSSPropertyAnimationPlayState:
return ConsumeIdent<CSSValueRunning, CSSValuePaused>(range);
case CSSPropertyTransitionProperty:
@@ -1672,10 +1655,6 @@ const CSSValue* CSSPropertyParser::ParseSingleValue(
range_);
case CSSPropertyAnimationIterationCount:
return ConsumeCommaSeparatedList(ConsumeAnimationIterationCount, range_);
- case CSSPropertyAnimationName:
- return ConsumeCommaSeparatedList(
- ConsumeAnimationName, range_, context_,
- unresolved_property == CSSPropertyAliasWebkitAnimationName);
case CSSPropertyAnimationPlayState:
return ConsumeCommaSeparatedList(
ConsumeIdent<CSSValueRunning, CSSValuePaused>, range_);

Powered by Google App Engine
This is Rietveld 408576698