1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Animation using matrix()
</title>
8 <style type=
"text/css" media=
"screen">
13 background-color: #
9bb;
14 -webkit-animation-name: horiz, vert;
15 -webkit-animation-duration:
1s;
16 -webkit-animation-iteration-count: infinite;
17 -webkit-animation-direction: alternate;
18 -webkit-animation-timing-function: linear;
21 @-webkit-keyframes horiz {
25 @-webkit-keyframes vert {
30 <script type=
"text/javascript" charset=
"utf-8">
31 if (window.layoutTestController) {
32 layoutTestController.dumpAsText();
33 layoutTestController.waitUntilDone();
37 const defaultTolerance =
15;
39 const expected = [
1,
0,
0,
1,
0,
0 ];
41 function isEqual(actual, desired, tolerance)
43 if (tolerance == undefined || tolerance ==
0)
44 tolerance = defaultTolerance;
45 var diff = Math.abs(actual - desired);
46 return diff < tolerance;
51 var target = document.getElementById(
"box");
52 var left = window.getComputedStyle(target).left;
53 target.style.webkitAnimationName =
"vert";
54 target.style.left = left;
59 var target = document.getElementById(
"box");
60 var left = parseInt(window.getComputedStyle(target).left);
61 var top = parseInt(window.getComputedStyle(target).top);
63 if (!isEqual(left,
150)) {
64 result =
"FAIL('left' was:"+left+
", expected:150)";
67 if (!isEqual(top,
225)) {
68 result =
"FAIL('top' was:"+top+
", expected:225)";
75 // We only want to continue for one of the two animations running
76 if (event.animationName ==
"horiz")
79 setTimeout(
"removeAnim()",
500);
80 setTimeout(
"snapshot()",
750);
82 window.setTimeout(function() {
83 document.getElementById('result').innerHTML = result;
84 if (window.layoutTestController)
85 layoutTestController.notifyDone();
89 document.addEventListener('webkitAnimationStart', start, false);
93 This test performs two animations, left and top. It animates over
1 second.
94 At
0.5 second it removes the left animation and the top animation should continue
95 from where it left off.