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>Test Changing Name of A Keyframes Rule Using CSSOM
</title>
8 <style type=
"text/css" media=
"screen">
15 background-color: blue;
16 -webkit-animation-duration:
0.5s;
17 -webkit-animation-timing-function: linear;
18 -webkit-animation-name: bar;
20 @-webkit-keyframes foo {
27 <script src=
"resources/animation-test-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
28 <script type=
"text/javascript" charset=
"utf-8">
30 const expectedValues = [
31 // [time, element-id, property, expected-value, tolerance]
32 [
0.25,
"box",
"left",
200,
20],
35 function findKeyframesRule(rule)
37 var ss = document.styleSheets;
38 for (var i =
0; i < ss.length; ++i) {
39 for (var j =
0; j < ss[i].cssRules.length; ++j) {
40 if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RULE && ss[i].cssRules[j].name == rule)
41 return ss[i].cssRules[j];
50 // change keyframes name
51 var keyframes = findKeyframesRule(
"foo");
52 keyframes.name =
"anim";
53 document.getElementById('box').style.webkitAnimationName =
"anim";
55 runAnimationTest(expectedValues, null, null, 'do-not-use-pause-api');
60 if (window.testRunner) {
61 testRunner.dumpAsText();
62 testRunner.waitUntilDone();
64 setTimeout(change,
200);
69 <body onload=
"setup()">
70 This test changes the name of the @keyframes rule so that it matches
71 and makes sure the animation starts running.