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>Testing Rotations
> 180 degrees
</title>
8 <style type=
"text/css" media=
"screen">
13 background-color: blue;
14 -webkit-animation-duration:
1.03s;
15 -webkit-animation-timing-function: linear;
16 -webkit-animation-name:
"rotate";
18 @-webkit-keyframes
"rotate" {
19 from { -webkit-transform: rotate(
0); }
20 to { -webkit-transform: rotate(
558deg); }
23 <script type=
"text/javascript" charset=
"utf-8">
24 if (window.layoutTestController) {
25 layoutTestController.dumpAsText();
26 layoutTestController.waitUntilDone();
30 const defaultTolerance =
0.2;
31 const expected = [ [ -
1,
0,
0,-
1 ],
35 function isEqual(actual, desired, tolerance)
37 if (tolerance == undefined || tolerance ==
0)
38 tolerance = defaultTolerance;
39 var diff = Math.abs(actual - desired);
40 return diff < tolerance;
43 function snapshot(which)
48 var s = window.getComputedStyle(document.getElementById('box')).webkitTransform;
50 var a = a[
1].split(
",");
51 for (i =
0; i <
4; ++i)
52 if (!isEqual(a[i], expected[which][i])) {
53 result =
"FAIL(property'"+i+
"' was:"+a[i]+
", expected:"+expected[which][i]+
")";
60 setTimeout(
"snapshot(0)",
333);
61 setTimeout(
"snapshot(1)",
667);
62 setTimeout(
"snapshot(2)",
1000);
64 window.setTimeout(function() {
65 document.getElementById('result').innerHTML = result;
66 if (window.layoutTestController)
67 layoutTestController.notifyDone();
71 document.addEventListener('webkitAnimationStart', start, false);
77 This test shows rotation of
> 180 degrees. The box should make one and a half rotations.