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 #target { |
| 20 background-color: lightsteelblue; |
| 21 width: 50px; |
| 22 height: 50px; |
| 23 position: absolute; |
| 24 left: 0px; |
| 25 } |
| 26 |
| 27 #spacer { |
| 28 height: 100px; |
| 29 } |
| 30 </style> |
| 31 |
| 32 |
| 33 <div id="target"></div> |
| 34 <div id="spacer"></div> |
| 35 |
| 36 <script> |
| 37 var expected_failures = { |
| 38 }; |
| 39 </script> |
| 40 <script src="../bootstrap.js"></script> |
| 41 <script> |
| 42 'use strict'; |
| 43 |
| 44 var target = document.querySelector('#target'); |
| 45 |
| 46 document.timeline.play(new Animation(target, {left: '100px', composite: 'add'},
{duration: 1, iterations: 2, direction: 'alternate'})); |
| 47 |
| 48 at(0.5, function() { |
| 49 assert_equals(0, target.style.length); |
| 50 assert_equals('', target.style.left); |
| 51 }); |
| 52 |
| 53 testharness_timeline.schedule(function() { |
| 54 target.style.left = '50px'; |
| 55 assert_styles(target, {left: '150px'}, 'getComputedStyle() should return corre
ct value after setting inline style.'); |
| 56 }, 1000); |
| 57 |
| 58 at(1.5, function() { |
| 59 assert_equals(1, target.style.length); |
| 60 assert_equals('50px', target.style.left); |
| 61 }); |
| 62 |
| 63 testharness_timeline.schedule(function() { |
| 64 target.style.cssText = 'left: 100px; background-color: green;'; |
| 65 }, 2500); |
| 66 |
| 67 at(3, function() { |
| 68 assert_equals(2, target.style.length); |
| 69 assert_equals('100px', target.style.left); |
| 70 assert_not_equals('', target.style.backgroundColor); |
| 71 }); |
| 72 |
| 73 </script> |
OLD | NEW |