blob: d7bd1d615bb51554816e267225bdf96ddb319d89 [file] [log] [blame]
<!DOCTYPE html>
<style>
body {
font-size: 10px;
}
</style>
<body>
<template id="target-template">
<svg width="0" height="0" viewBox="0 0 1000 1000">
<text class="target"/>
</svg>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
'use strict';
assertAttributeInterpolation({
property: 'x',
from: '0, -1, 2',
to: '5, -6, 7',
}, [
{at: -0.4, is: '-2, 1, 0'},
{at: 0, is: '0, -1, 2'},
{at: 0.2, is: '1, -2, 3'},
{at: 0.6, is: '3, -4, 5'},
{at: 1, is: '5, -6, 7'},
{at: 1.4, is: '7, -8, 9'},
]);
assertAttributeInterpolation({
property: 'x',
from: '0em, 1ex, 2rem',
to: '5em, 6ex, 7rem',
}, [
{at: -0.4, is: '-2em, -1ex, 0rem'},
{at: 0, is: '0em, 1ex, 2rem'},
{at: 0.2, is: '1em, 2ex, 3rem'},
{at: 0.6, is: '3em, 4ex, 5rem'},
{at: 1, is: '5em, 6ex, 7rem'},
{at: 1.4, is: '7em, 8ex, 9rem'},
]);
assertAttributeInterpolation({
property: 'x',
from: '55%, 5em, 0',
to: '5em, 55%, 0',
}, [
{at: -0.4, is: '750, -150, 0'},
{at: 0, is: '550, 50, 0'},
{at: 0.2, is: '450, 150, 0'},
{at: 0.6, is: '250, 350, 0'},
{at: 1, is: '50, 550, 0'},
{at: 1.4, is: '-150, 750, 0'},
]);
</script>
</body>