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 { | |
20 left: 0px; | |
21 width: 30px; | |
22 height: 30px; | |
23 background-color: lightsteelblue; | |
24 position: absolute; | |
25 } | |
26 | |
27 .expected { | |
28 width: 30px; | |
29 height: 30px; | |
30 position: absolute; | |
31 background-color: red; | |
32 } | |
33 </style> | |
34 <div style="height: 400px"></div> | |
35 | |
36 <script> | |
37 var expected_failures = [ | |
38 { | |
39 browser_configurations: [{ msie: true }], | |
40 tests: ['Autogenerated'], | |
41 message: 'Floating point issues.', | |
42 } | |
43 ]; | |
44 </script> | |
45 <script src="../bootstrap.js"></script> | |
46 <script> | |
47 "use strict"; | |
48 | |
49 var transformValues = [ | |
50 ['translate(0px, 0px)', 'translate(10em)', 'translate(10%, 1in)'], | |
51 ['rotate(0deg)', 'rotate(50deg)', 'rotate(3rad)', 'rotate(200grad)'], | |
52 ['skew(0deg)', 'skew(20rad)', 'skew(40grad, 20rad)'], | |
53 ['skewX(0deg)', 'skewX(20grad)', 'skewX(40rad)'], | |
54 ['skewY(0deg)', 'skewY(20rad)', 'skewY(40grad)'] | |
55 ]; | |
56 | |
57 var separation_x = 100; | |
58 var separation_y = 50; | |
59 var max_x = 1000; | |
60 | |
61 var toplevel = document.querySelector("div"); | |
62 var y = 50; | |
63 var animations = []; | |
64 for (var i = 0; i < transformValues.length; i++) { | |
65 var x = 10; | |
66 for (var j = 0; j < transformValues[i].length; j++) { | |
67 for (var k = 0; k < transformValues[i].length; k++) { | |
68 if (j == k) { | |
69 continue; | |
70 } | |
71 toplevel.appendChild(document.createElement("div")); | |
72 var div = toplevel.lastChild; | |
73 div.className = "expected"; | |
74 div.style.top = y + 'px'; | |
75 div.style.left = x + 'px'; | |
76 div.style[_WebAnimationsTestingUtilities._prefixProperty('transform')] = t
ransformValues[i][k]; | |
77 toplevel.appendChild(document.createElement("div")); | |
78 var div = toplevel.lastChild; | |
79 div.className = "anim"; | |
80 div.style.top = y + 'px'; | |
81 div.style.left = x + 'px'; | |
82 div.id = "i" + i + "_" + j + "_" + k | |
83 animations.push(new Animation(div, [ | |
84 {transform: transformValues[i][j]}, | |
85 {transform: transformValues[i][k]}, | |
86 ], {duration: 2 * 1000, fill: 'forwards'})); | |
87 x += separation_x; | |
88 if (x > max_x) { | |
89 x = 20; | |
90 y += separation_y; | |
91 } | |
92 } | |
93 } | |
94 y += separation_y; | |
95 } | |
96 | |
97 animations.forEach(function(anim) { document.timeline.play(anim); }); | |
98 </script> | |
OLD | NEW |