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

Unified Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp

Issue 2896543002: Implements CSSPropertyAPI for the animation-name property. (Closed)
Patch Set: Change parseSingleValue method to take local context as input. 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 | « third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.h ('k') | 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/properties/CSSPropertyAnimationNameUtils.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..074d4dcfe5224d40d40e4c43bd94a6968974816c
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/properties/CSSPropertyAnimationNameUtils.h"
+
+#include "core/css/parser/CSSPropertyParserHelpers.h"
+#include "core/frame/UseCounter.h"
+
+namespace blink {
+
+CSSValue* CSSPropertyAnimationNameUtils::ConsumeAnimationName(
+ CSSParserTokenRange& range,
+ const CSSParserContext* context,
+ bool allow_quoted_name) {
+ if (range.Peek().Id() == CSSValueNone)
+ return CSSPropertyParserHelpers::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 CSSPropertyParserHelpers::ConsumeCustomIdent(range);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698