mirror of
https://github.com/servo/servo.git
synced 2025-07-02 04:53:39 +01:00
55 lines
1.7 KiB
HTML
55 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>offset-distance interpolation</title>
|
|
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
|
|
<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-distance-property">
|
|
<meta name="assert" content="offset-distance supports animation.">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="resources/interpolation-testcommon.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
test_interpolation({
|
|
property: 'offset-distance',
|
|
from: '-30px',
|
|
to: '50px',
|
|
}, [
|
|
{at: -1, expect: '-110px'},
|
|
{at: 0, expect: '-30px'},
|
|
{at: 0.125, expect: '-20px'},
|
|
{at: 0.875, expect: '40px'},
|
|
{at: 1, expect: '50px'},
|
|
{at: 2, expect: '130px'}
|
|
]);
|
|
|
|
test_interpolation({
|
|
property: 'offset-distance',
|
|
from: '20%',
|
|
to: '100%',
|
|
}, [
|
|
{at: -1, expect: '-60%'},
|
|
{at: 0, expect: '20%'},
|
|
{at: 0.125, expect: '30%'},
|
|
{at: 0.875, expect: '90%'},
|
|
{at: 1, expect: '100%'},
|
|
{at: 2, expect: '180%'}
|
|
]);
|
|
|
|
test_interpolation({
|
|
property: 'offset-distance',
|
|
from: 'calc(20% - 30px)',
|
|
to: 'calc(50px + 100%)',
|
|
}, [
|
|
{at: -1, expect: 'calc(-110px + -60%)'},
|
|
{at: 0, expect: 'calc(20% - 30px)'},
|
|
{at: 0.125, expect: 'calc(-20px + 30%)'},
|
|
{at: 0.875, expect: 'calc(40px + 90%)'},
|
|
{at: 1, expect: 'calc(50px + 100%)'},
|
|
{at: 2, expect: 'calc(130px + 180%)'}
|
|
]);
|
|
</script>
|
|
</body>
|
|
</html>
|