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><meta charset="UTF-8"> |
| 18 <style> |
| 19 .anim { |
| 20 left: 0px; |
| 21 width: 100px; |
| 22 height: 100px; |
| 23 background-color: #FAA; |
| 24 position: absolute; |
| 25 } |
| 26 |
| 27 .expected { |
| 28 width: 100px; |
| 29 height: 100px; |
| 30 position: absolute; |
| 31 border-right: 1px solid black; |
| 32 } |
| 33 |
| 34 #a { |
| 35 top: 50px |
| 36 } |
| 37 </style> |
| 38 |
| 39 <div>Right edge of box should align with black line at end of test.</div> |
| 40 <div id="a" class="anim"></div> |
| 41 <div id="a-expected" style="top: 50px; left: 200px;" class="expected"></div> |
| 42 |
| 43 <script src="../bootstrap.js" nopolyfill></script> |
| 44 <script> |
| 45 "use strict"; |
| 46 |
| 47 timing_test(function() { |
| 48 at(0.00, function() { assert_styles(".anim", {"left": "0px"}) }); |
| 49 at(0.25, function() { assert_styles(".anim", {"left": "100px"}) }); |
| 50 at(0.50, function() { assert_styles(".anim", {"left": "200px"}) }); |
| 51 }, "Check left position"); |
| 52 |
| 53 window.addEventListener('load', function() { |
| 54 var s = document.createElement('script'); |
| 55 s.src = "../../web-animations.js"; |
| 56 s.addEventListener('load', function() { |
| 57 document.timeline.play(new Animation(a, |
| 58 [{left: "0px"}, {left: "200px"}], |
| 59 {duration: 0.5, fill: 'forwards'} |
| 60 )); |
| 61 |
| 62 }) |
| 63 document.head.appendChild(s); |
| 64 }); |
| 65 </script> |
OLD | NEW |