Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="test" content="background-position-y supports animation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<style>
.parent {
background-position-y: 60px;
}
.target {
background-position-y: 40px;
}
</style>
<body>
<script>
test_interpolation({
property: 'background-position-y',
from: neutralKeyframe,
to: '80px',
}, [
{at: -0.25, expect: '30px'},
{at: 0, expect: '40px'},
{at: 0.25, expect: '50px'},
{at: 0.5, expect: '60px'},
{at: 0.75, expect: '70px'},
{at: 1, expect: '80px'},
{at: 1.25, expect: '90px'},
]);
test_interpolation({
property: 'background-position-y',
from: 'initial',
to: 'bottom',
}, [
{at: -0.25, expect: '-25%'},
{at: 0, expect: '0%'},
{at: 0.25, expect: '25%'},
{at: 0.5, expect: '50%'},
{at: 0.75, expect: '75%'},
{at: 1, expect: '100%'},
{at: 1.25, expect: '125%'},
]);
test_interpolation({
property: 'background-position-y',
from: 'inherit',
to: '80px',
}, [
{at: -0.25, expect: '55px'},
{at: 0, expect: '60px'},
{at: 0.25, expect: '65px'},
{at: 0.5, expect: '70px'},
{at: 0.75, expect: '75px'},
{at: 1, expect: '80px'},
{at: 1.25, expect: '85px'},
]);
test_interpolation({
property: 'background-position-y',
from: '300px, 400px',
to: '500px, 600px, 700px',
}, [
{at: -0.25, expect: '250px, 350px, 200px, 375px, 225px, 325px'},
{at: 0, expect: '300px, 400px, 300px, 400px, 300px, 400px'},
{at: 0.25, expect: '350px, 450px, 400px, 425px, 375px, 475px'},
{at: 0.5, expect: '400px, 500px, 500px, 450px, 450px, 550px'},
{at: 0.75, expect: '450px, 550px, 600px, 475px, 525px, 625px'},
{at: 1, expect: '500px, 600px, 700px, 500px, 600px, 700px'},
{at: 1.25, expect: '550px, 650px, 800px, 525px, 675px, 775px'},
]);
</script>
</body>