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

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

Issue 1068973004: Web Animations: Support animation of SVG number attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 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 | LayoutTests/animations/svg-attribute-interpolation/svg-offset-interpolation.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
diff --git a/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js b/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
index 7fde59bfa04e3384eb361cbdbdaac48015381fb8..fdfe3fd449ce263b38567be4d9f7a4d6991149e2 100644
--- a/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
+++ b/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
@@ -188,6 +188,13 @@
return value;
}
+ function serializeSVGNumberList(numberList) {
+ var elements = [];
+ for (var index = 0; index < numberList.numberOfItems; ++index)
+ elements.push(numberList.getItem(index).value);
+ return String(elements);
+ }
+
function serializeSVGPointList(pointList) {
var elements = [];
for (var index = 0; index < pointList.numberOfItems; ++index) {
@@ -240,6 +247,8 @@
if (!result) {
if (attributeName === 'filterResX' || attributeName === 'filterResY')
return null;
+ if (attributeName === 'pathLength')
+ return '0';
console.log('Unknown attribute, cannot get ' + element.className.baseVal + ' ' + attributeName);
return null;
@@ -247,6 +256,8 @@
if (result instanceof SVGAngle)
result = result.value;
+ else if (result instanceof SVGNumberList)
+ result = serializeSVGNumberList(result);
else if (result instanceof SVGPointList)
result = serializeSVGPointList(result);
else if (result instanceof SVGRect)
@@ -284,8 +295,9 @@
}
}
- // The following collide with CSS properties.
+ // The following collide with CSS properties or the Web Animations API (offset).
var svgPrefixedAttributes = [
+ 'offset',
'order',
];
« no previous file with comments | « no previous file | LayoutTests/animations/svg-attribute-interpolation/svg-offset-interpolation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698