7 opacity: 0; /* hide from pixel test */
14 background-color: green;
15 -webkit-animation: anim1 0.1s ease 0s forwards;
22 background-color: red;
23 -webkit-transform: translate3d(50px, 200px, 0);
26 @-webkit-keyframes anim1 {
28 -webkit-transform: translate3d(100px, 0, 0);
31 -webkit-transform: translate3d(200px, 0, 0);
35 @-webkit-keyframes anim2 {
37 -webkit-transform: translate3d(50px, 0, 0);
40 -webkit-transform: translate3d(50px, 200px, 0);
47 var expectedValue = "matrix(1, 0, 0, 1, 50, 200)";
51 var result = document.getElementById("result");
52 var computedValue = window.getComputedStyle(box).webkitTransform;
54 if (computedValue == expectedValue)
55 result.innerHTML = "PASS - final state was " + expectedValue;
57 result.innerHTML = "FAIL - final state was " + computedValue + " expected " + expectedValue;
59 if (window.layoutTestController)
60 layoutTestController.notifyDone();
65 // remove this listener
66 box.removeEventListener("webkitAnimationEnd", swapAnim);
67 // add the test listener
68 box.addEventListener("webkitAnimationEnd", testState, false);
69 // change the animation
70 box.style.webkitAnimation = "anim2 0.1s ease 0s forwards";
75 box = document.getElementById("box");
76 document.addEventListener("webkitAnimationEnd", swapAnim, false);
79 if (window.layoutTestController) {
80 layoutTestController.dumpAsText(true);
81 layoutTestController.waitUntilDone();
84 window.addEventListener("load", setup, false);
90 This sets up two animations. It runs the first and then triggers the 2nd. The first fills
91 forwards, but should still be replaced by the second. The first is a horizontal animation, the second is
92 vertical, so the box should end up translated vertically down the page.
94 <div id="correctposition">