blob: a1508194f8bbd10d2ea6a6a4d04334308af3cadf [file] [log] [blame]
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.parent {
text-indent: 70px;
}
.target {
font: 10px sans-serif;
text-indent: 10px;
margin-left: 20px;
}
.expected {
color: green;
}
</style>
<body>
<script src="resources/interpolation-test.js"></script>
<template id="target-template">T</template>
<script>
assertInterpolation({
property: 'text-indent',
from: neutralKeyframe,
to: '40px',
}, [
{at: -0.3, is: '1px'},
{at: 0, is: '10px'},
{at: 0.3, is: '19px'},
{at: 0.6, is: '28px'},
{at: 1, is: '40px'},
{at: 1.5, is: '55px'},
]);
assertInterpolation({
property: 'text-indent',
from: 'initial',
to: '20px',
}, [
{at: -0.3, is: '-6px'},
{at: 0, is: '0px'},
{at: 0.3, is: '6px'},
{at: 0.6, is: '12px'},
{at: 1, is: '20px'},
{at: 1.5, is: '30px'},
]);
assertInterpolation({
property: 'text-indent',
from: 'inherit',
to: '20px',
}, [
{at: -0.3, is: '85px'},
{at: 0, is: '70px'},
{at: 0.3, is: '55px'},
{at: 0.6, is: '40px'},
{at: 1, is: '20px'},
{at: 1.5, is: '-5px'},
]);
assertInterpolation({
property: 'text-indent',
from: 'unset',
to: '20px',
}, [
{at: -0.3, is: '85px'},
{at: 0, is: '70px'},
{at: 0.3, is: '55px'},
{at: 0.6, is: '40px'},
{at: 1, is: '20px'},
{at: 1.5, is: '-5px'},
]);
assertInterpolation({
property: 'text-indent',
from: '0px',
to: '50px'
}, [
{at: -0.3, is: '-15px'},
{at: 0, is: '0'},
{at: 0.3, is: '15px'},
{at: 0.6, is: '30px'},
{at: 1, is: '50px'},
{at: 1.5, is: '75px'},
]);
assertInterpolation({
property: 'text-indent',
from: '0px hanging',
to: '50px hanging',
}, [
{at: -0.3, is: '-15px hanging'},
{at: 0, is: '0 hanging'},
{at: 0.3, is: '15px hanging'},
{at: 0.6, is: '30px hanging'},
{at: 1, is: '50px hanging'},
{at: 1.5, is: '75px hanging'},
]);
assertInterpolation({
property: 'text-indent',
from: '0px hanging each-line',
to: '50px each-line hanging',
}, [
{at: -0.3, is: '-15px hanging each-line'},
{at: 0, is: '0 hanging each-line'},
{at: 0.3, is: '15px hanging each-line'},
{at: 0.6, is: '30px hanging each-line'},
{at: 1, is: '50px hanging each-line'},
{at: 1.5, is: '75px hanging each-line'},
]);
assertNoInterpolation({
property: 'text-indent',
from: '0px each-line',
to: '50px hanging',
});
assertNoInterpolation({
property: 'text-indent',
from: '0px',
to: '50px each-line hanging',
});
</script>
</body>