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

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

Issue 2747523002: Web Animations: support cssOffset (Closed)
Patch Set: method Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 this.interpolateComposite(property, from, 'replace', to, 'replace', at, ta rget); 129 this.interpolateComposite(property, from, 'replace', to, 'replace', at, ta rget);
130 }, 130 },
131 interpolateComposite: function(property, from, fromComposite, to, toComposit e, at, target) { 131 interpolateComposite: function(property, from, fromComposite, to, toComposit e, at, target) {
132 // Convert standard properties to camelCase. 132 // Convert standard properties to camelCase.
133 if (!property.startsWith('--')) { 133 if (!property.startsWith('--')) {
134 for (var i = property.length - 2; i > 0; --i) { 134 for (var i = property.length - 2; i > 0; --i) {
135 if (property[i] === '-') { 135 if (property[i] === '-') {
136 property = property.substring(0, i) + property[i + 1].toUpperCase() + property.substring(i + 2); 136 property = property.substring(0, i) + property[i + 1].toUpperCase() + property.substring(i + 2);
137 } 137 }
138 } 138 }
139 if (property === 'offset')
140 property = 'cssOffset';
139 } 141 }
140 var keyframes = []; 142 var keyframes = [];
141 if (!isNeutralKeyframe(from)) { 143 if (!isNeutralKeyframe(from)) {
142 keyframes.push({ 144 keyframes.push({
143 offset: 0, 145 offset: 0,
144 composite: fromComposite, 146 composite: fromComposite,
145 [property]: from, 147 [property]: from,
146 }); 148 });
147 } 149 }
148 if (!isNeutralKeyframe(to)) { 150 if (!isNeutralKeyframe(to)) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 asyncHandle.done() 468 asyncHandle.done()
467 }); 469 });
468 }); 470 });
469 471
470 window.assertInterpolation = assertInterpolation; 472 window.assertInterpolation = assertInterpolation;
471 window.assertNoInterpolation = assertNoInterpolation; 473 window.assertNoInterpolation = assertNoInterpolation;
472 window.assertComposition = assertComposition; 474 window.assertComposition = assertComposition;
473 window.afterTest = afterTest; 475 window.afterTest = afterTest;
474 window.neutralKeyframe = neutralKeyframe; 476 window.neutralKeyframe = neutralKeyframe;
475 })(); 477 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698