123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>Testing animation-name: none</title>
-
- <style type="text/css" media="screen">
- div {
- width: 300px;
- height: 100px;
- margin: 10px;
- -webkit-animation-name: 'fail';
- -webkit-animation-duration: 3.5s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
- @-webkit-keyframes 'fail' {
- from {
- transform: rotate(-90deg);
- }
- to {
- transform: rotate(90deg);
- }
- }
- #box1 {
- position: relative;
- background-color: blue;
- -webkit-animation-name: 'sway1';
- -webkit-animation-duration: 2.5s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
-
- @-webkit-keyframes 'sway1' {
- from {
- transform: translate(0, 0);
- }
- to {
- transform: translate(200px, 0);
- }
- }
-
- #box2 {
- position: relative;
- background-color: red;
- -webkit-animation-name: 'sway2';
- -webkit-animation-duration: 3s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
-
- @-webkit-keyframes 'sway2' {
- from {
- transform: translate(0px, 0);
- }
- to {
- transform: translate(200px, 0);
- }
- }
- #box3 {
- position: relative;
- background-color: green;
- -webkit-animation-name: 'sway3';
- -webkit-animation-duration: 3.5s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
- @-webkit-keyframes 'sway3' {
- from {
- transform: translate(0px, 0);
- }
- to {
- transform: translate(200px, 0);
- }
- }
- #box4 {
- position: relative;
- background-color: orange;
- -webkit-animation-name: 'none';
- -webkit-animation-duration: 3s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
- #box5 {
- position: relative;
- background-color: purple;
- -webkit-animation-name: 'none';
- -webkit-animation-duration: 3s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-timing-function: linear;
- }
- #box6 {
- position: relative;
- background-color: blue;
- -webkit-animation-name: 'fade', 'sway6';
- -webkit-animation-duration: 3s, 4s;
- -webkit-animation-iteration-count: infinite, infinite;
- -webkit-animation-direction: alternate, alternate;
- -webkit-animation-timing-function: linear, linear;
- }
- @-webkit-keyframes 'sway6' {
- from {
- transform: translate(0px, 0);
- }
- to {
- transform: translate(200px, 0);
- }
- }
- @-webkit-keyframes 'fade' {
- from {
- opacity: 1.0;
- }
- to {
- opacity: 0.1;
- }
- }
- /* set up animation that should never be run */
- @-webkit-keyframes none {
- from {
- transform: translate(200px, 0) rotate(-90deg);
- }
- to {
- transform: translate(0px, 0) rotate(90deg);
- }
- }
- </style>
- <script type="text/javascript" charset="utf-8">
- function killanims() {
- console.log("click");
- var box1 = document.getElementById("box1");
- box1.style.webkitAnimationName = '';
- var box2 = document.getElementById("box2");
- box2.style.webkitAnimationName = 'none';
- var box3 = document.getElementById("box3");
- box3.style.webkitAnimationName = "'none'";
- var box6 = document.getElementById("box6");
- box6.style.webkitAnimationName = "none, 'sway6'";
- }
-
- setTimeout(killanims, 2000);
- </script>
- </head>
- <body>
-
- <h2>Testing animation: none</h2>
-
- <p>
- After 2 seconds only the blue rectangles should be
- animating.
- Any resulting animation
- that involves rotation or fading means that this test has FAILED.</p>
-
- <div id="box1">
- This rectangle starts with an animation. After 2 seconds a timer
- will set the animation-name on the element to '' (the empty string).
- The CSS rule should cause the animation to continue.
- </div>
- <div id="box2">
- This rectangle starts with an animation. After 2 seconds a timer
- will set the animation-name on the element to 'none' (as an identifier).
- This should cause the animation to stop.
- </div>
- <div id="box3">
- This rectangle starts with an animation. After 2 seconds a timer
- will set the animation-name on the element to 'none' (as a string).
- This should cause the animation to stop.
- </div>
- <div id="box4">
- This rectangle starts with an animation, but animation-name is
- set to 'none' (as an identifier). No animation should run.
- </div>
- <div id="box5">
- This rectangle starts with an animation, but animation-name is
- set to 'none' (as a string). No animation should run.
- </div>
- <div id="box6">
- This rectangle starts with two animations. After 2 seconds a timer
- will set the animation-name on the fade to 'none'. The other
- animation (horizontal) should continue.
- </div>
-
- </body>
- </html>
|