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() { |