| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyTransitionPropertyUtils.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyTransitionPropertyUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyTransitionPropertyUtils.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7ec446920f03e234ef0088c4dfc532cf914b16e2
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyTransitionPropertyUtils.cpp
|
| @@ -0,0 +1,49 @@
|
| +// 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/CSSPropertyTransitionPropertyUtils.h"
|
| +
|
| +#include "core/CSSPropertyNames.h"
|
| +#include "core/CSSValueKeywords.h"
|
| +#include "core/css/CSSCustomIdentValue.h"
|
| +#include "core/css/CSSIdentifierValue.h"
|
| +#include "core/css/CSSPropertyMetadata.h"
|
| +#include "core/css/CSSValue.h"
|
| +#include "core/css/CSSValueList.h"
|
| +#include "core/css/parser/CSSParserToken.h"
|
| +#include "core/css/parser/CSSParserTokenRange.h"
|
| +#include "core/css/parser/CSSPropertyParserHelpers.h"
|
| +
|
| +namespace blink {
|
| +
|
| +CSSValue* CSSPropertyTransitionPropertyUtils::ConsumeTransitionProperty(
|
| + CSSParserTokenRange& range) {
|
| + const CSSParserToken& token = range.Peek();
|
| + if (token.GetType() != kIdentToken)
|
| + return nullptr;
|
| + if (token.Id() == CSSValueNone)
|
| + return CSSPropertyParserHelpers::ConsumeIdent(range);
|
| + CSSPropertyID unresolved_property = token.ParseAsUnresolvedCSSPropertyID();
|
| + if (unresolved_property != CSSPropertyInvalid &&
|
| + unresolved_property != CSSPropertyVariable) {
|
| + DCHECK(CSSPropertyMetadata::IsEnabledProperty(unresolved_property));
|
| + range.ConsumeIncludingWhitespace();
|
| + return CSSCustomIdentValue::Create(unresolved_property);
|
| + }
|
| + return CSSPropertyParserHelpers::ConsumeCustomIdent(range);
|
| +}
|
| +
|
| +bool CSSPropertyTransitionPropertyUtils::IsValidAnimationPropertyList(
|
| + const CSSValueList& value_list) {
|
| + if (value_list.length() < 2)
|
| + return true;
|
| + for (auto& value : value_list) {
|
| + if (value->IsIdentifierValue() &&
|
| + ToCSSIdentifierValue(*value).GetValueID() == CSSValueNone)
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|