Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/PropertyRegistration.cpp |
| diff --git a/third_party/WebKit/Source/core/css/PropertyRegistration.cpp b/third_party/WebKit/Source/core/css/PropertyRegistration.cpp |
| index ae24ecec42ab833bcdf29c01747beb2d1c74c4ca..6df5664d7a047c1e7ad3432c4857144126c1d228 100644 |
| --- a/third_party/WebKit/Source/core/css/PropertyRegistration.cpp |
| +++ b/third_party/WebKit/Source/core/css/PropertyRegistration.cpp |
| @@ -4,6 +4,8 @@ |
| #include "core/css/PropertyRegistration.h" |
| +#include "core/animation/CSSColorInterpolationType.h" |
|
Timothy Loh
2017/01/09 05:07:23
not used yet
alancutter (OOO until 2018)
2017/01/16 00:23:52
Removed
|
| +#include "core/animation/CSSValueInterpolationType.h" |
| #include "core/css/CSSSyntaxDescriptor.h" |
| #include "core/css/CSSValueList.h" |
| #include "core/css/CSSVariableReferenceValue.h" |
| @@ -56,6 +58,17 @@ static bool computationallyIndependent(const CSSValue& value) { |
| return true; |
| } |
| +InterpolationTypes interpolationTypesForSyntax(const AtomicString& propertyName, |
| + const CSSSyntaxDescriptor&) { |
| + PropertyHandle property(propertyName); |
| + InterpolationTypes interpolationTypes; |
| + // TODO(alancutter): Read the syntax descriptor and add the appropriate |
| + // CSSInterpolationType subclasses. |
| + interpolationTypes.append( |
| + WTF::makeUnique<CSSValueInterpolationType>(property)); |
| + return interpolationTypes; |
| +} |
| + |
| void PropertyRegistration::registerProperty( |
| ExecutionContext* executionContext, |
| const PropertyDescriptor& descriptor, |
| @@ -89,6 +102,9 @@ void PropertyRegistration::registerProperty( |
| return; |
| } |
| + InterpolationTypes interpolationTypes = |
| + interpolationTypesForSyntax(atomicName, syntaxDescriptor); |
| + |
| if (descriptor.hasInitialValue()) { |
| CSSTokenizer tokenizer(descriptor.initialValue()); |
| bool isAnimationTainted = false; |
| @@ -108,9 +124,9 @@ void PropertyRegistration::registerProperty( |
| } |
| RefPtr<CSSVariableData> initialVariableData = CSSVariableData::create( |
| tokenizer.tokenRange(), isAnimationTainted, false); |
| - registry.registerProperty(atomicName, syntaxDescriptor, |
| - descriptor.inherits(), initial, |
| - initialVariableData.release()); |
| + registry.registerProperty( |
| + atomicName, syntaxDescriptor, descriptor.inherits(), initial, |
| + initialVariableData.release(), std::move(interpolationTypes)); |
| } else { |
| if (!syntaxDescriptor.isTokenStream()) { |
| exceptionState.throwDOMException( |
| @@ -119,7 +135,8 @@ void PropertyRegistration::registerProperty( |
| return; |
| } |
| registry.registerProperty(atomicName, syntaxDescriptor, |
| - descriptor.inherits(), nullptr, nullptr); |
| + descriptor.inherits(), nullptr, nullptr, |
| + std::move(interpolationTypes)); |
| } |
| // TODO(timloh): Invalidate only elements with this custom property set |