| 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 .animContainer { | |
| 20 position: absolute; | |
| 21 left: 0px; | |
| 22 height: 225px; | |
| 23 } | |
| 24 | |
| 25 .expected { | |
| 26 border-right: 1px solid black; | |
| 27 } | |
| 28 | |
| 29 .anim { | |
| 30 left: 0px; | |
| 31 width: 100px; | |
| 32 height: 25px; | |
| 33 background-color: #FAA; | |
| 34 position: relative; | |
| 35 } | |
| 36 | |
| 37 #ca { | |
| 38 top: 50px; | |
| 39 width: 400px; | |
| 40 } | |
| 41 | |
| 42 #cb { | |
| 43 top: 150px; | |
| 44 width: 200px; | |
| 45 } | |
| 46 | |
| 47 </style> | |
| 48 | |
| 49 <div>Right edge of each box should align with black line at end of test.</div> | |
| 50 | |
| 51 <div class="animContainer" id="ca"> | |
| 52 <div style="width: 400px;" class="expected"><div class="anim a" id="a"></div> | |
| 53 </div> | |
| 54 <div style="width: 400px;" class="expected"><div class="anim b" id="b"></div> | |
| 55 </div> | |
| 56 </div> | |
| 57 | |
| 58 <div class="animContainer" id="cb"> | |
| 59 <div style="width: 200px;" class="expected"><div class="anim a" id="c"></div> | |
| 60 </div> | |
| 61 <div style="width: 200px;" class="expected"><div class="anim b" id="d"></div> | |
| 62 </div> | |
| 63 </div> | |
| 64 | |
| 65 <div style="height:200px;"></div> | |
| 66 | |
| 67 <script src="../bootstrap.js"></script> | |
| 68 <script> | |
| 69 "use strict"; | |
| 70 | |
| 71 var containers = ["ca", "cb"]; | |
| 72 | |
| 73 var directions = ["normal", "reverse"]; | |
| 74 | |
| 75 var animation = [{left: "100px"}, {left: "300px"}]; | |
| 76 | |
| 77 for (var i = 0; i < directions.length; i++) { | |
| 78 var container = document.getElementById(containers[i]); | |
| 79 // Explicit parent duration. | |
| 80 document.timeline.play(new AnimationGroup( | |
| 81 [new Animation(container.getElementsByClassName("a")[0], animation, | |
| 82 {duration: 1.0 * 1000, fill: 'forwards'})], | |
| 83 {iterations: 2.0, direction: directions[i], duration: 1.0 * 1000})); | |
| 84 // Parent calculates intrinsic duration. | |
| 85 document.timeline.play(new AnimationGroup( | |
| 86 [new Animation(container.getElementsByClassName("b")[0], animation, | |
| 87 {duration: 1.0 * 1000, fill: 'forwards'})], | |
| 88 {iterations: 2.0, direction: directions[i]})); | |
| 89 } | |
| 90 </script> | |
| OLD | NEW |