blob: bb67f7675e591d6d85d8d3eba21a39947b119409 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<template id="target-template">
<svg width="90" height="90">
<linearGradient class="target" />
</svg>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
'use strict';
assertAttributeInterpolation({
property: 'gradientTransform',
from: 'translate(10 20)',
to: 'translate(30 60)'
}, [
{at: -0.4, is: 'translate(2,4)'},
{at: 0, is: 'translate(10 20)'},
{at: 0.2, is: 'translate(14,28)'},
{at: 0.6, is: 'translate(22,44)'},
{at: 1, is: 'translate(30 60)'},
{at: 1.4, is: 'translate(38,76)'}
]);
assertAttributeInterpolation({
property: 'gradientTransform',
from: 'scale(10 20)',
to: 'scale(30 60)'
}, [
{at: -0.4, is: 'scale(2 4)'},
{at: 0, is: 'scale(10 20)'},
{at: 0.2, is: 'scale(14 28)'},
{at: 0.6, is: 'scale(22 44)'},
{at: 1, is: 'scale(30 60)'},
{at: 1.4, is: 'scale(38 76)'}
]);
assertAttributeInterpolation({
property: 'gradientTransform',
from: 'rotate(10 20 30)',
to: 'rotate(40 80 160)'
}, [
{at: -0.4, is: 'rotate(-2 -4 -22)'},
{at: 0, is: 'rotate(10 20 30)'},
{at: 0.2, is: 'rotate(16 32 56)'},
{at: 0.6, is: 'rotate(28 56 108)'},
{at: 1, is: 'rotate(40 80 160)'},
{at: 1.4, is: 'rotate(52 104 212)'}
]);
assertAttributeInterpolation({
property: 'gradientTransform',
from: 'skewX(10)',
to: 'skewX(20)'
}, [
{at: -0.4, is: 'skewX(6)'},
{at: 0, is: 'skewX(10)'},
{at: 0.2, is: 'skewX(12)'},
{at: 0.6, is: 'skewX(16)'},
{at: 1, is: 'skewX(20)'},
{at: 1.4, is: 'skewX(24)'}
]);
assertAttributeInterpolation({
property: 'gradientTransform',
from: 'skewY(10)',
to: 'skewY(20)'
}, [
{at: -0.4, is: 'skewY(6)'},
{at: 0, is: 'skewY(10)'},
{at: 0.2, is: 'skewY(12)'},
{at: 0.6, is: 'skewY(16)'},
{at: 1, is: 'skewY(20)'},
{at: 1.4, is: 'skewY(24)'}
]);
</script>
</body>
</html>