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

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
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 53dbda1a46af47fe2f558a6097f878888f3e2e6a..ea7c96e0b4510d5c4b537443f725a03fdf730a7a 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) {
@@ -236,6 +243,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;
@@ -243,6 +252,8 @@
if (result instanceof SVGAngle)
result = result.value;
+ else if (result instanceof SVGNumberList)
+ result = serializeSVGNumberList(result);
else if (result instanceof SVGPointList)
result = serializeSVGPointList(result);
@@ -278,8 +289,9 @@
}
}
- // The following collide with CSS properties.
+ // The following collide with CSS properties or the Web Animations API (offset).
var svgPrefixedAttributes = [
+ 'offset',
'order',
];

Powered by Google App Engine
This is Rietveld 408576698