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

Unified Diff: tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js

Issue 1904663006: Web Animations: Use camelCase for property name in performance test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js
diff --git a/tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js b/tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js
index b985bdfc541b6e583802c7a8df228997fe8d558a..45a1d207593f920eb4cda79669f6acbc383665a8 100644
--- a/tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js
+++ b/tools/perf/page_sets/tough_animation_cases/resources/css_value_type.js
@@ -3,6 +3,17 @@
// found in the LICENSE file.
'use strict';
+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;
+}
+
function perfTestCSSValue(options) {
var svgTag = options.svgTag;
var property = options.property;
@@ -47,8 +58,8 @@ function perfTestCSSValue(options) {
break;
case 'web_animations':
var keyframes = [{}, {}];
- keyframes[0][property] = from;
- keyframes[1][property] = to;
+ keyframes[0][toCamelCase(property)] = from;
+ keyframes[1][toCamelCase(property)] = to;
targets.forEach(function(target) {
target.animate(keyframes, {
duration: duration,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698