blob: 05bdcbf7325406602a84c65ed21ab854fc3dd65e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/ahem.js"></script>
<style>
:root {
font: 50px Ahem;
}
</style>
</head>
<body>
<svg>
<defs>
<path id="path1" d="m 0 0 h 250 v 250 h -250 z"/>
</defs>
</svg>
<template id="target-template">
<svg width="7px" height="17px" viewBox="0 0 140 340">
<text text-anchor="middle">
<textPath xlink:href="#path1" startOffset="50%" class="target">
Text on a path
</textPath>
</text>
</svg>
</template>
<script src="../svg-attribute-interpolation/resources/interpolation-test.js"></script>
<script>
'use strict';
assertAttributeInterpolation({
property: 'startOffset',
underlying: '2',
from: '-1',
fromComposite: 'add',
to: '4',
toComposite: 'add'
}, [
{at: -0.4, is: -1},
{at: 0, is: 1},
{at: 0.2, is: 2},
{at: 0.6, is: 4},
{at: 1, is: 6},
{at: 1.4, is: 8}
]);
assertAttributeInterpolation({
property: 'startOffset',
underlying: '1in',
from: '9in',
fromComposite: 'add',
to: '698pt',
toComposite: 'add'
}, [
{at: -0.4, is: '700pt'},
{at: 0, is: '720pt'},
{at: 0.2, is: '730pt'},
{at: 0.6, is: '750pt'},
{at: 1, is: '770pt'},
{at: 1.4, is: '790pt'}
]);
assertAttributeInterpolation({
property: 'startOffset',
underlying: '50',
from: '75',
fromComposite: 'add',
to: '19em',
toComposite: 'add'
}, [
{at: -0.4, is: '-225'},
{at: 0, is: '125'},
{at: 0.2, is: '300'},
{at: 0.6, is: '650'},
{at: 1, is: '1000'},
{at: 1.4, is: '1350'}
]);
</script>
</body>
</html>