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>Keyframes test with comma separated keys
</title>
8 <style type=
"text/css" media=
"screen">
15 background-color: blue;
16 -webkit-animation-duration:
1s;
17 -webkit-animation-timing-function: linear;
18 -webkit-animation-name:
"anim";
20 @-webkit-keyframes
"anim" {
22 20%,
40% { left:
100px; }
23 60%,
80%{ left:
200px; }
27 <script type=
"text/javascript" charset=
"utf-8">
28 if (window.layoutTestController) {
29 layoutTestController.dumpAsText();
30 layoutTestController.waitUntilDone();
34 const defaultTolerance =
0.2;
36 function isEqual(actual, desired, tolerance)
38 if (tolerance == undefined || tolerance ==
0)
39 tolerance = defaultTolerance;
40 var diff = Math.abs(actual - desired);
41 return diff < tolerance;
44 function snapshot(which)
49 var left = parseInt(window.getComputedStyle(document.getElementById('box')).left);
50 var expected = which ?
200 :
100;
51 if (!isEqual(left, expected))
52 result =
"FAIL(was:"+left+
", expected:"+expected+
")";
57 setTimeout(
"snapshot(0)",
300);
58 setTimeout(
"snapshot(1)",
700);
60 window.setTimeout(function() {
61 document.getElementById('result').innerHTML = result;
62 if (window.layoutTestController)
63 layoutTestController.notifyDone();
67 document.addEventListener('webkitAnimationStart', start, false);
72 This test performs an animation of the left property. It should stop for
100ms at
100px and
200px
73 We test for those values
50ms after it has stopped at each position. Keys in two of the keyframes
74 are comma separated, so these should be correctly broken out into separate keyframes.