Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="test" content="background-image 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-image: url(../resources/blue-100.png);
background-size: 0 0;
}
.target {
width: 100px;
height: 100px;
display: inline-block;
border: 10px solid black;
background-repeat: no-repeat;
background-image: url(../resources/blue-100.png);
}
.expected {
border-color: green;
margin-right: 2px;
}
</style>
<body>
<script>
// Neutral to image
var from = 'url(../resources/blue-100.png)';
var to = 'url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: neutralKeyframe,
to: to,
});
// initial to image
to = 'url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: 'initial',
to: to,
});
// inherit to image
from = 'url(../resources/blue-100.png)';
to = 'url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: 'inherit',
to: to,
});
// unset to image
test_no_interpolation({
property: 'background-image',
from: 'unset',
to: to,
});
// Image to image
from = 'url(../resources/blue-100.png)';
to = 'url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Image to gradient
from = 'url(../resources/blue-100.png)';
to = 'linear-gradient(45deg, blue, orange)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Image to crossfade
from = 'url(../resources/blue-100.png)';
to = 'cross-fade(url(../resources/green-100.png) 50%, url(../resources/stripes-100.png) 50%)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Gradient to gradient
from = 'linear-gradient(-45deg, red, yellow)';
to = 'linear-gradient(45deg, blue, orange)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Keyword to image
from = 'none';
to = 'url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Multiple to multiple
var fromA = 'url(../resources/stripes-100.png)';
var fromB = 'url(../resources/blue-100.png)';
var toA = 'url(../resources/blue-100.png)';
var toB = 'url(../resources/stripes-100.png)';
from = fromA + ', ' + fromB;
to = toA + ', ' + toB;
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Single to multiple
from = 'url(../resources/blue-100.png)';
var toA = 'url(../resources/stripes-100.png)';
var toB = 'url(../resources/green-100.png)';
to = toA + ', ' + toB;
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
// Multiple mismatched types
from = 'url(../resources/blue-100.png), none';
to = 'url(../resources/stripes-100.png), url(../resources/green-100.png)';
test_no_interpolation({
property: 'background-image',
from: from,
to: to,
});
</script>
</body>