Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js

Issue 1771733002: Web Animations: Use of hyphens is no longer supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/LayoutTests/animations/interpolation/resources/interpolation-test.js
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js b/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
index 14a138da2439291ce7ada03568ccf4f61bf52c0e..efeab748d505c7f9d74909b0162c464f557aecc0 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
@@ -63,6 +63,15 @@
var expectNoInterpolation = {};
var afterTestHook = function() {};
+ function toCamelCase(property) {
+ for (var i = property.length - 2; i > 0; --i) {
+ if (property[i] === '-') {
+ property = property.substring(0, i) + property[i + 1].toUpperCase() + property.substring(i + 2);
+ }
+ }
+ return property;
+ }
+
alancutter (OOO until 2018) 2016/03/07 03:08:53 This helper function should be below the configura
Eric Willigers 2016/03/09 03:21:21 Done.
var cssAnimationsInterpolation = {
name: 'CSS Animations',
supportsProperty: function() {return true;},
@@ -118,12 +127,7 @@
return expectFlip(from, to, 0.5);
},
interpolate: function(property, from, to, at, target) {
- // Convert to camelCase
- for (var i = property.length - 2; i > 0; --i) {
- if (property[i] === '-') {
- property = property.substring(0, i) + property[i + 1].toUpperCase() + property.substring(i + 2);
- }
- }
+ property = toCamelCase(property);
this.interpolateKeyframes([
{offset: 0, [property]: from},
{offset: 1, [property]: to},
@@ -339,11 +343,11 @@ assertComposition({
webAnimationsInterpolation.interpolateKeyframes([{
offset: 0,
composite: fromComposite,
- [property]: from,
+ [toCamelCase(property)]: from,
}, {
offset: 1,
composite: toComposite,
- [property]: to,
+ [toCamelCase(property)]: to,
}], expectation.at, target);
};
target.measure = function() {

Powered by Google App Engine
This is Rietveld 408576698