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/PropertyRegistration.cpp

Issue 2618673003: Store registered property InterpolationTypes in PropertyRegistration (Closed)
Patch Set: Remove duplicate Created 3 years, 11 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
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..410ae2c900bf7b26544e15ce2d03ed907961020c 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/CSSValueInterpolationType.h"
#include "core/css/CSSSyntaxDescriptor.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSVariableReferenceValue.h"
@@ -56,6 +57,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 +101,9 @@ void PropertyRegistration::registerProperty(
return;
}
+ InterpolationTypes interpolationTypes =
+ interpolationTypesForSyntax(atomicName, syntaxDescriptor);
+
if (descriptor.hasInitialValue()) {
CSSTokenizer tokenizer(descriptor.initialValue());
bool isAnimationTainted = false;
@@ -108,9 +123,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 +134,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
« no previous file with comments | « third_party/WebKit/Source/core/animation/InterpolationType.h ('k') | third_party/WebKit/Source/core/css/PropertyRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698