blob: a96741133bece3d8d3fe93219140e43c4c0fc455 [file] [log] [blame]
<html>
<head>
<style>
#box {
position: absolute;
left: 100px;
top: 100px;
height: 100px;
width: 100px;
background-color: red;
-webkit-animation: anim 1s linear infinite;
}
#boxStatic {
position: absolute;
left: 100px;
top: 200px;
height: 100px;
width: 100px;
background-color: red;
-webkit-mask-image: -webkit-cross-fade(url(resources/stripes-100.png), url(resources/green-100.png), 25%);
}
@-webkit-keyframes anim {
from { -webkit-mask-image: url(resources/stripes-100.png); }
to { -webkit-mask-image: url(resources/green-100.png); }
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
// This test was flaky because it would start before the images were loaded.
var imagesLoaded = 0;
function imageLoaded() {
++imagesLoaded;
if (imagesLoaded == 2) {
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[2.25, ["box", "boxStatic"], "webkitMaskImage", 0.25, 0.05]
];
var doPixelTest = true;
var disablePauseAPI = false;
var startTestImmediately = true;
runAnimationTest(expectedValues, null, undefined, disablePauseAPI, doPixelTest, startTestImmediately);
}
}
</script>
</head>
<body>
<img id="box" src="resources/green-100.png" onLoad="imageLoaded()";/>
<img id="boxStatic" src="resources/stripes-100.png" onLoad="imageLoaded();"/>
<div id="result"></div>
</body>
</html>