blob: 4b2732dc37305907153233bade5310d385a3996f [file] [log] [blame]
<!DOCTYPE>
<html>
<head>
<style>
.box {
height: 200px;
width: 200px;
margin: 10px;
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: linear;
}
#box {
border-image: url('../animations/resources/blue-100.png') 5 5 5 5 /40px stretch stretch;
-webkit-transition-property: border-image-source;
}
#box.final {
border-image-source: url('../animations/resources/stripes-100.png');
}
#boxShorthand {
border-image: url('../animations/resources/blue-100.png') 5 5 5 5 /40px stretch stretch;
-webkit-transition-property: border-image;
}
#boxShorthand.final {
border-image: url('../animations/resources/stripes-100.png') 5 5 5 5 /40px stretch stretch;
}
#boxStatic {
border-image: -webkit-cross-fade(url(../animations/resources/blue-100.png), url(../animations/resources/stripes-100.png), 0.5) 5 5 5 5 /40px stretch stretch;
}
</style>
<script src="../animations/resources/animation-test-helpers.js" type="text/javascript"></script>
<script>
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, ['box', 'boxStatic'], 'border-image-source', null, 0.05],
[0.5, ['boxShorthand', 'boxStatic'], 'border-image', null, 0.05],
];
function setupTest()
{
document.getElementById('box').className = 'box final';
document.getElementById('boxShorthand').className = 'box final';
}
// This test was flaky because it would start before the images were loaded.
var imagesLoaded = 0;
function imageLoaded() {
++imagesLoaded;
if (imagesLoaded == 2)
runTransitionTest(expectedValues, setupTest);
}
</script>
</head>
<body>
<div id="box" class="box"></div>
<div id="boxShorthand" class="box"></div>
<div id="boxStatic" class="box"></div>
<div id="result"></div>
<img src="../animations/resources/stripes-100.png" onLoad="imageLoaded();"/>
<img src="../animations/resources/blue-100.png" onLoad="imageLoaded();"/>
</body>
</html>