| 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 2d049f680983e2e42cec3f87ec2429f0b430ff12..ff078f38b22f82736960149a56fb66931d765986 100644
|
| --- a/third_party/WebKit/Source/core/css/PropertyRegistration.cpp
|
| +++ b/third_party/WebKit/Source/core/css/PropertyRegistration.cpp
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "core/css/PropertyRegistration.h"
|
|
|
| +#include "core/animation/CSSInterpolationTypesMap.h"
|
| #include "core/css/CSSStyleSheet.h"
|
| #include "core/css/CSSSyntaxDescriptor.h"
|
| #include "core/css/CSSValueList.h"
|
| @@ -21,6 +22,31 @@
|
|
|
| namespace blink {
|
|
|
| +static InterpolationTypes setRegistrationOnCSSInterpolationTypes(
|
| + CSSInterpolationTypes cssInterpolationTypes,
|
| + const PropertyRegistration& registration) {
|
| + InterpolationTypes result;
|
| + for (auto& cssInterpolationType : cssInterpolationTypes) {
|
| + cssInterpolationType->setCustomPropertyRegistration(registration);
|
| + result.push_back(std::move(cssInterpolationType));
|
| + }
|
| + return result;
|
| +}
|
| +
|
| +PropertyRegistration::PropertyRegistration(
|
| + const CSSSyntaxDescriptor& syntax,
|
| + bool inherits,
|
| + const CSSValue* initial,
|
| + PassRefPtr<CSSVariableData> initialVariableData,
|
| + CSSInterpolationTypes cssInterpolationTypes)
|
| + : m_syntax(syntax),
|
| + m_inherits(inherits),
|
| + m_initial(initial),
|
| + m_initialVariableData(initialVariableData),
|
| + m_interpolationTypes(setRegistrationOnCSSInterpolationTypes(
|
| + std::move(cssInterpolationTypes),
|
| + *this)) {}
|
| +
|
| static bool computationallyIndependent(const CSSValue& value) {
|
| DCHECK(!value.isCSSWideKeyword());
|
|
|
| @@ -93,8 +119,9 @@ void PropertyRegistration::registerProperty(
|
| return;
|
| }
|
|
|
| - InterpolationTypes interpolationTypes =
|
| - syntaxDescriptor.createInterpolationTypes(atomicName);
|
| + CSSInterpolationTypes cssInterpolationTypes =
|
| + CSSInterpolationTypesMap::createCSSInterpolationTypesForSyntax(
|
| + atomicName, syntaxDescriptor);
|
|
|
| if (descriptor.hasInitialValue()) {
|
| CSSTokenizer tokenizer(descriptor.initialValue());
|
| @@ -121,7 +148,7 @@ void PropertyRegistration::registerProperty(
|
| tokenizer.tokenRange(), isAnimationTainted, false);
|
| registry.registerProperty(
|
| atomicName, syntaxDescriptor, descriptor.inherits(), initial,
|
| - std::move(initialVariableData), std::move(interpolationTypes));
|
| + std::move(initialVariableData), std::move(cssInterpolationTypes));
|
| } else {
|
| if (!syntaxDescriptor.isTokenStream()) {
|
| exceptionState.throwDOMException(
|
| @@ -131,7 +158,7 @@ void PropertyRegistration::registerProperty(
|
| }
|
| registry.registerProperty(atomicName, syntaxDescriptor,
|
| descriptor.inherits(), nullptr, nullptr,
|
| - std::move(interpolationTypes));
|
| + std::move(cssInterpolationTypes));
|
| }
|
|
|
| // TODO(timloh): Invalidate only elements with this custom property set
|
|
|