blob: 1e58689fbb9fecf3507b042f306f6d0353a157cd [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
<html>
<head>
<title>For Bug 26150 - Negative values for animation-delay are ignored</title>
<style type="text/css">
.square {
background: blue;
width: 20px;
height: 20px;
position: absolute;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
}
.move {
-webkit-animation-name: square-move;
}
.translate {
-webkit-animation-name: square-translate;
}
@-webkit-keyframes square-move {
0% { left: 0px; }
100% { left: 600px; }
}
@-webkit-keyframes square-translate {
0% { -webkit-transform: translateX(0); }
100% { -webkit-transform: translateX(600px); }
}
#square1 {
top: 20px;
left: 20px;
-webkit-animation-delay: -1s;
}
#square2 {
top: 60px;
left: 20px;
}
#square3 {
top: 100px;
left: 20px;
-webkit-animation-delay: -1s;
}
#square4 {
top: 140px;
left: 20px;
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script>
// The delay of square1 is negative so square1 should be in ahead of square2.
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["square-move", 0, "square1", "left", 300, 15],
["square-move", 0, "square2", "left", 0, 15],
["square-move", 0.5, "square1", "left", 450, 15],
["square-move", 0.5, "square2", "left", 150, 15],
["square-translate", 0, "square3", "webkitTransform.4", 300, 20],
["square-translate", 0, "square4", "webkitTransform.4", 0, 20],
["square-translate", 0.5, "square3", "webkitTransform.4", 450, 20],
["square-translate", 0.5, "square4", "webkitTransform.4", 150, 20],
];
runAnimationTest(expectedValues);
</script>
</head>
<body>
<div class="square move" id="square1"></div>
<div class="square move" id="square2"></div>
<div class="square translate" id="square3"></div>
<div class="square translate" id="square4"></div>
<div id="result">
</div>
</body>
</html>