blob: a6659c2ff0f4f34f4f16a4968da1dd237f4c9d0e [file] [log] [blame]
div {
position: relative;
height: 100px;
width: 100px;
background: blue;
transform: translateZ(0);
-webkit-animation-direction: alternate;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: linear;
-webkit-animation-fill-mode: both;
.test0 {
-webkit-animation-iteration-count: 0;
.test1 {
-webkit-animation-iteration-count: 0.5;
.test2 {
-webkit-animation-iteration-count: 1;
.test3 {
-webkit-animation-iteration-count: 1.5;
.test4 {
-webkit-animation-iteration-count: 2;
.test5 {
-webkit-animation-iteration-count: 2.5;
.anim-left {
-webkit-animation-name: anim-left;
z-index: 100;
.anim-transform {
-webkit-animation-name: anim-transform;
z-index: 200;
@-webkit-keyframes anim-left {
0% {
left: 0px;
100% {
left: 300px;
@-webkit-keyframes anim-transform {
0% {
transform: translateX(0px);
100% {
transform: translateX(300px);
Each section below has two boxes, the top runs on the main thread, the bottom
on the compositor. The animations should be identical but start at different
This test is successful if the boxes are mostly in sync (there might be a small
offset between them).
Iteration count 0 (should not animate)
<div class='test0 anim-left'></div>
<div class='test0 anim-transform'></div>
Iteration count 0.5 (should finish first in the middle)
<div class='test1 anim-left'></div>
<div class='test1 anim-transform'></div>
Iteration count 1 (should finish second at the end)
<div class='test2 anim-left'></div>
<div class='test2 anim-transform'></div>
Iteration count 1.5 (should finish third in the middle)
<div class='test3 anim-left'></div>
<div class='test3 anim-transform'></div>
Iteration count 2 (should finish fourth at the start)
<div class='test4 anim-left'></div>
<div class='test4 anim-transform'></div>
Iteration count 2.5 (should finish last in the middle)
<div class='test5 anim-left'></div>
<div class='test5 anim-transform'></div>