OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright 2012 Google Inc. All Rights Reserved. | |
3 | |
4 Licensed under the Apache License, Version 2.0 (the "License"); | |
5 you may not use this file except in compliance with the License. | |
6 You may obtain a copy of the License at | |
7 | |
8 http://www.apache.org/licenses/LICENSE-2.0 | |
9 | |
10 Unless required by applicable law or agreed to in writing, software | |
11 distributed under the License is distributed on an "AS IS" BASIS, | |
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 See the License for the specific language governing permissions and | |
14 limitations under the License. | |
15 --> | |
16 | |
17 <!DOCTYPE html><meta charset="UTF-8"> | |
18 <style> | |
19 .anim, .anim2 { | |
20 fill: lightsteelblue; | |
21 } | |
22 | |
23 .expectation { | |
24 fill: red; | |
25 } | |
26 </style> | |
27 <svg> | |
28 <rect class="expectation" x="200px" y="10px" width="100px" height="100px"> | |
29 </rect> | |
30 <rect class="expectation" x="200px" y="20px" width="200px" height="200px"> | |
31 </rect> | |
32 <rect class="anim" x="100px" y="10px" width="100px" height="100px"></rect> | |
33 <rect class="anim2" x="100px" y="10px" width="100px" height="100px"></rect> | |
34 </svg> | |
35 <script> | |
36 var expected_failures = [ | |
37 { | |
38 browser_configurations: [ | |
39 { firefox: true }, | |
40 { msie: true }, | |
41 ], | |
42 tests: ['Auto generated tests at t=(1|2|3|4|5|6)000ms'], | |
43 message: 'Getting weird numbers in ctm.', | |
44 } | |
45 ]; | |
46 </script> | |
47 <script src="../bootstrap.js"></script> | |
48 <script> | |
49 "use strict"; | |
50 var rect = document.querySelector(".anim") | |
51 var rect2 = document.querySelector(".anim2") | |
52 | |
53 var dt = document.timeline; | |
54 | |
55 dt.play(new Animation(rect, [{x: "0px"}, {x: "400px"}], {duration: 3 * 1000, fil
l: 'forwards'})); | |
56 dt.play(new Animation(rect, | |
57 new KeyframeEffect([{x: "0px"}, {x: "200px"}], 'add'), | |
58 {delay: 1 * 1000, duration: 4 * 1000, fill: 'forwards'})); | |
59 | |
60 dt.play(new Animation(rect2, [ | |
61 {transform: "translate(0px, 0px)"}, | |
62 {transform: "translate(200px, 200px)"}, | |
63 ], {duration: 3 * 1000, fill: 'forwards'})); | |
64 dt.play(new Animation(rect2, new KeyframeEffect([ | |
65 {transform: "rotate(0deg) translate(0px, 0px)"}, | |
66 {transform: "rotate(90deg) translate(100px, 0px)"}, | |
67 ], 'add'), {delay: 1 * 1000, duration: 4 * 1000, fill: 'forwards'})); | |
68 </script> | |
OLD | NEW |