1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>Test of -webkit-animation-play-state interacting with suspendAnimation</title>
6 <style type="text/css" media="screen">
10 background-color: blue;
12 -webkit-animation-duration: 2s;
13 -webkit-animation-timing-function: linear;
14 -webkit-animation-name: "move1";
15 -webkit-animation-play-state: running;
17 @-webkit-keyframes "move1" {
18 from { -webkit-transform: translateX(0); }
19 to { -webkit-transform: translateX(400px); }
26 background-color: red;
27 -webkit-animation-duration: 2s;
28 -webkit-animation-timing-function: linear;
29 -webkit-animation-name: "move2";
31 @-webkit-keyframes "move2" {
36 <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
37 <script type="text/javascript" charset="utf-8">
39 const expectedValues = [
40 // [animation-name, time, element-id, property, expected-value, tolerance]
41 ["move1", 0.55, "box1", "webkitTransform", [1,0,0,1,100,0], 20],
42 ["move1", 0.65, "box1", "webkitTransform", [1,0,0,1,100,0], 20],
43 ["move1", 0.75, "box1", "webkitTransform", [1,0,0,1,100,0], 20],
44 ["move1", 1, "box1", "webkitTransform", [1,0,0,1,140,0], 20],
45 ["move2", 0.55, "box2", "left", 100, 20],
46 ["move2", 0.65, "box2", "left", 100, 20],
47 ["move2", 0.75, "box2", "left", 100, 20],
48 ["move2", 1, "box2", "left", 140, 20],
53 document.getElementById("box1").style.webkitAnimationPlayState = "paused";
54 document.getElementById("box2").style.webkitAnimationPlayState = "paused";
60 internals.suspendAnimations(document);
65 document.getElementById("box1").style.webkitAnimationPlayState = "running";
66 document.getElementById("box2").style.webkitAnimationPlayState = "running";
72 internals.resumeAnimations(document);
77 setTimeout(pause, 500);
78 setTimeout(suspend, 600);
79 setTimeout(unpause, 700);
80 setTimeout(resume, 800);
83 runAnimationTest(expectedValues, setTimers, null /* event */, true /* disablePauseAnimationAPI */);
89 This test makes sure a play-state change in an animation during suspend does not resume the animation.