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

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

Issue 1413463008: Web Animations: Migrate SVG path interpolation to interpolation types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/svg-attribute-interpolation/resources/interpolation-test.js
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
index fee72b2a7d703863d97d2c9353ed4296b7f3121b..16484d640eb8ca543516c262cecdeb3bbde6eff3 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
@@ -58,6 +58,9 @@
}
function normalizeValue(value) {
+ if (value === null) {
+ return '-NULL-';
+ }
return roundNumbers(value).
// Place whitespace between tokens.
replace(/([\w\d.]+|[^\s])/g, '$1 ').
@@ -314,16 +317,22 @@
case 'Web Animations':
// Replace 'transform' with 'svgTransform', etc. This avoids collisions with CSS properties or the Web Animations API (offset).
var prefixedProperty = 'svg' + params.property[0].toUpperCase() + params.property.slice(1);
- target.animate([
- {
+ var keyFrames = [];
+ if (params.from !== '') {
+ keyFrames.push({
+ offset: 0,
[prefixedProperty]: params.from,
composite: params.fromComposite,
- },
- {
+ })
+ }
+ if (params.to !== '') {
+ keyFrames.push({
+ offset: 1,
[prefixedProperty]: params.to,
composite: params.toComposite,
- },
- ], {
+ })
+ }
+ target.animate(keyFrames, {
fill: 'forwards',
duration: 1,
easing: createEasing(expectation.at),

Powered by Google App Engine
This is Rietveld 408576698