blob: 217f7bacb3059dfcafbeda4928de04c05e447ab9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<template id="target-template">
<svg width="90" height="90">
<line x1="1" y1="2" x2="3" y2="4" class="target" />
</svg>
</template>
<script src="../svg-attribute-interpolation/resources/interpolation-test.js"></script>
<script>
'use strict';
assertAttributeInterpolation({
property: 'transform',
underlying: 'skewX(10)',
from: 'translate(10 20)',
fromComposite: 'add',
to: 'rotate(30 40 50)',
toComposite: 'add'
}, [
{at: -0.4, is: 'skewX(10) translate(10 20)'},
{at: 0, is: 'skewX(10) translate(10 20)'},
{at: 0.2, is: 'skewX(10) translate(10 20)'},
{at: 0.6, is: 'skewX(10) rotate(30 40 50)'},
{at: 1, is: 'skewX(10) rotate(30 40 50)'},
{at: 1.4, is: 'skewX(10) rotate(30 40 50)'}
]);
assertAttributeInterpolation({
property: 'transform',
underlying: 'translate(5 5)',
from: 'translate(5 15)',
fromComposite: 'add',
to: 'rotate(30 40 50)',
toComposite: 'add'
}, [
{at: -0.4, is: 'translate(5 5) translate(5 15)'},
{at: 0, is: 'translate(5 5) translate(5 15)'},
{at: 0.2, is: 'translate(5 5) translate(5 15)'},
{at: 0.6, is: 'translate(5 5) rotate(30 40 50)'},
{at: 1, is: 'translate(5 5) rotate(30 40 50)'},
{at: 1.4, is: 'translate(5 5) rotate(30 40 50)'}
]);
assertAttributeInterpolation({
property: 'transform',
underlying: 'skewY(5)',
from: 'skewX(10)',
fromComposite: 'add',
to: 'skewY(15)',
toComposite: 'add'
}, [
{at: -0.4, is: 'skewY(5) skewX(10)'},
{at: 0, is: 'skewY(5) skewX(10)'},
{at: 0.2, is: 'skewY(5) skewX(10)'},
{at: 0.6, is: 'skewY(5) skewY(15)'},
{at: 1, is: 'skewY(5) skewY(15)'},
{at: 1.4, is: 'skewY(5) skewY(15)'}
]);
assertAttributeInterpolation({
property: 'transform',
underlying: 'translate(5 5)',
from: neutralKeyframe,
to: 'skewY(20)',
toComposite: 'add'
}, [
{at: -0.4, is: 'translate(5 5)'},
{at: 0, is: 'translate(5 5)'},
{at: 0.2, is: 'translate(5 5)'},
{at: 0.6, is: 'translate(5 5) skewY(20)'},
{at: 1, is: 'translate(5 5) skewY(20)'},
{at: 1.4, is: 'translate(5 5) skewY(20)'}
]);
</script>
</body>
</html>