blob: a122b45f964a52c7336ebadfb584de17591df339 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.target {
width: 50px;
height: 50px;
background-color: black;
display: inline-block;
border: 25px;
}
.replica {
background-color: green;
margin-right: 2px;
}
</style>
<body>
<script src="resources/interpolation-test.js"></script>
<script>
// None to image
var from = 'none';
var to = 'url(../resources/stripes-100.png)';
assertInterpolation({
property: 'border-image-source',
from: from,
to: to
}, [
{at: -0.3, is: from},
{at: 0, is: from},
{at: 0.3, is: from},
{at: 0.6, is: to},
{at: 1, is: to},
{at: 1.5, is: to},
]);
// Image to image
from = 'url(../resources/green-100.png)';
to = 'url(../resources/stripes-100.png)';
assertInterpolation({
property: 'border-image-source',
from: from,
to: to
}, [
{at: -0.3, is: from},
{at: 0, is: from},
{at: 0.3, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.3)'},
{at: 0.6, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.6)'},
{at: 1, is: to},
{at: 1.5, is: to},
]);
// Image to gradient
to = 'linear-gradient(45deg, blue, orange)';
assertInterpolation({
property: 'border-image-source',
from: from,
to: to
}, [
{at: -0.3, is: from},
{at: 0, is: from},
{at: 0.3, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.3)'},
{at: 0.6, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.6)'},
{at: 1, is: to},
{at: 1.5, is: to},
]);
// Gradient to gradient
from = 'linear-gradient(-45deg, red, yellow)';
assertInterpolation({
property: 'border-image-source',
from: from,
to: to
}, [
{at: -0.3, is: from},
{at: 0, is: from},
{at: 0.3, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.3)'},
{at: 0.6, is: '-webkit-cross-fade(' + from + ', ' + to + ', 0.6)'},
{at: 1, is: to},
{at: 1.5, is: to},
]);
</script>
</body>