OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/css/properties/CSSPropertyAnimationNameUtils.h" |
| 6 |
| 7 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 8 #include "core/frame/UseCounter.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 CSSValue* CSSPropertyAnimationNameUtils::ConsumeAnimationName( |
| 13 CSSParserTokenRange& range, |
| 14 const CSSParserContext* context, |
| 15 bool allow_quoted_name) { |
| 16 if (range.Peek().Id() == CSSValueNone) |
| 17 return CSSPropertyParserHelpers::ConsumeIdent(range); |
| 18 |
| 19 if (allow_quoted_name && range.Peek().GetType() == kStringToken) { |
| 20 // Legacy support for strings in prefixed animations. |
| 21 context->Count(UseCounter::kQuotedAnimationName); |
| 22 |
| 23 const CSSParserToken& token = range.ConsumeIncludingWhitespace(); |
| 24 if (EqualIgnoringASCIICase(token.Value(), "none")) |
| 25 return CSSIdentifierValue::Create(CSSValueNone); |
| 26 return CSSCustomIdentValue::Create(token.Value().ToAtomicString()); |
| 27 } |
| 28 |
| 29 return CSSPropertyParserHelpers::ConsumeCustomIdent(range); |
| 30 } |
| 31 |
| 32 } // namespace blink |
OLD | NEW |