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 | |
19 <style> | |
20 .anim { | |
21 position: absolute; | |
22 width: 50px; | |
23 height: 50px; | |
24 top: 0px; | |
25 left: 0px; | |
26 border-radius: 50%; | |
27 background-color: lightsteelblue; | |
28 } | |
29 </style> | |
30 <div class="anim" id="a"></div> | |
31 <script> | |
32 var expected_failures = [ | |
33 { | |
34 browser_configurations: [{ msie: true }], | |
35 tests: ['t=0.8s'], | |
36 message: 'Floating point issues.', | |
37 } | |
38 ]; | |
39 </script> | |
40 <script src="../bootstrap.js"></script> | |
41 <script> | |
42 "use strict"; | |
43 var timing = {duration: 0.2, fill: 'forwards'}; | |
44 var across = new Animation(document.querySelector("#a"), {left: "450px"}, timi
ng); | |
45 var pause1 = new Animation(null, {left: "500px"}, timing); | |
46 var pause2 = new Animation(null, null, timing); | |
47 var down = new Animation(document.querySelector("#a"), {top: "450px"}, timing)
; | |
48 var combo = new AnimationSequence([across, pause1, pause2, down]); | |
49 document.timeline.play(combo); | |
50 | |
51 timing_test(function() { | |
52 at(0.4, function() { | |
53 assert_equals(getComputedStyle(a).getPropertyValue("left"), "450px") | |
54 assert_equals(getComputedStyle(a).getPropertyValue("top"), "0px") | |
55 }); | |
56 }, "AnimationPlayer should do nothing for the duration of animations with null
targets.") | |
57 | |
58 timing_test(function() { | |
59 at(0.8, function() { | |
60 assert_equals(getComputedStyle(a).getPropertyValue("left"), "450px") | |
61 assert_equals(getComputedStyle(a).getPropertyValue("top"), "450px") | |
62 }); | |
63 }, | |
64 "AnimationPlayer should do nothing for duration of animations with null target
s, " + | |
65 "then continue with animations with real targets.") | |
66 </script> | |
OLD | NEW |