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 '/.* at t=0.8s/': { |
| 34 msie: true, |
| 35 message: "Floating point issues." |
| 36 } |
| 37 }; |
| 38 </script> |
| 39 <script src="../bootstrap.js"></script> |
| 40 <script> |
| 41 "use strict"; |
| 42 var timing = {duration: 0.2, fill: 'forwards'}; |
| 43 var across = new Animation(document.querySelector("#a"), {left: "450px"}, timi
ng); |
| 44 var pause1 = new Animation(null, {left: "500px"}, timing); |
| 45 var pause2 = new Animation(null, null, timing); |
| 46 var down = new Animation(document.querySelector("#a"), {top: "450px"}, timing)
; |
| 47 var combo = new SeqGroup([across, pause1, pause2, down]); |
| 48 document.timeline.play(combo); |
| 49 |
| 50 timing_test(function() { |
| 51 at(0.4, function() { |
| 52 assert_equals(getComputedStyle(a).getPropertyValue("left"), "450px") |
| 53 assert_equals(getComputedStyle(a).getPropertyValue("top"), "0px") |
| 54 }); |
| 55 }, "Player should do nothing for the duration of animations with null targets.
") |
| 56 |
| 57 timing_test(function() { |
| 58 at(0.8, function() { |
| 59 assert_equals(getComputedStyle(a).getPropertyValue("left"), "450px") |
| 60 assert_equals(getComputedStyle(a).getPropertyValue("top"), "450px") |
| 61 }); |
| 62 }, |
| 63 "Player should do nothing for duration of animations with null targets, " + |
| 64 "then continue with animations with real targets.") |
| 65 </script> |
OLD | NEW |