blob: bcc9b2136917efca533ca5c819b823ff4b43a159 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.parent {
offset-position: 30px 10px;
}
.target {
offset-position: 10px 30px;
}
</style>
<body>
<template id="target-template">
<div><div class="transformed"></div></div>
</template>
<script src="resources/interpolation-test.js"></script>
<script>
assertInterpolation({
property: 'offset-position',
from: neutralKeyframe,
to: '20px 20px',
}, [
{at: -0.3, is: '7px 33px'},
{at: 0, is: '10px 30px'},
{at: 0.3, is: '13px 27px'},
{at: 0.6, is: '16px 24px'},
{at: 1, is: '20px 20px'},
{at: 1.5, is: '25px 15px'},
]);
assertNoInterpolation({
property: 'offset-position',
from: 'initial',
to: '20px 20px',
});
assertInterpolation({
property: 'offset-position',
from: 'inherit',
to: '20px 20px',
}, [
{at: -0.3, is: '33px 7px'},
{at: 0, is: '30px 10px'},
{at: 0.3, is: '27px 13px'},
{at: 0.6, is: '24px 16px'},
{at: 1, is: '20px 20px'},
{at: 1.5, is: '15px 25px'},
]);
assertNoInterpolation({
property: 'offset-position',
from: 'unset',
to: '20px 20px',
});
assertInterpolation({
property: 'offset-position',
from: '0% 50%',
to: '100% 150%'
}, [
{at: -0.3, is: '-30% 20%'},
{at: 0, is: '0% 50%'},
{at: 0.3, is: '30% 80%'},
{at: 0.6, is: '60% 110%'},
{at: 1, is: '100% 150%'},
{at: 1.5, is: '150% 200%'}
]);
assertNoInterpolation({
property: 'offset-position',
from: 'auto',
to: '20px 20px',
});
</script>
</body>