OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright 2013 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> | |
18 <style> | |
19 div.anim { | |
20 position: relative; | |
21 left: 100px; | |
22 top: 100px; | |
23 width: 100px; | |
24 height: 100px; | |
25 background: blue; | |
26 } | |
27 </style> | |
28 | |
29 <div id='anim' class="anim">Text</div> | |
30 | |
31 <script src="../bootstrap.js"></script> | |
32 <script> | |
33 "use strict"; | |
34 | |
35 document.timeline.play(new Animation(anim, [{transform: 'scale(2)'}, {transform:
'rotate(45deg)'}], {duration: 1, fill: 'forwards'})); | |
36 | |
37 | |
38 timing_test(function() { | |
39 // should start as a scale(2) matrix | |
40 at(0, function() { | |
41 assert_styles('.anim', [{'transform': 'matrix(2, 0, 0, 2, 0, 0)'}]); | |
42 }); | |
43 | |
44 // should be a scale(1.5) rotate(22.5deg) matrix halfway though | |
45 at(0.5, function() { | |
46 assert_styles('.anim', [{'transform': 'matrix(1.3858, 0.574, -0.574, 1.3858,
0, 0)'}]); | |
47 }); | |
48 | |
49 // should end as a rotate(45deg) matrix | |
50 at(1, function() { | |
51 assert_styles('.anim', [{'transform': 'matrix(0.7071067811865476, 0.70710678
11865475, -0.7071067811865475, 0.7071067811865476, 0, 0)'}]); | |
52 }); | |
53 }); | |
54 | |
55 </script> | |
OLD | NEW |