| 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 src="../bootstrap.js"></script> | |
| 37 <script> | |
| 38 'use strict'; | |
| 39 | |
| 40 var target = document.querySelector('#target'); | |
| 41 | |
| 42 document.timeline.play(new Animation(target, {left: '100px', composite: 'add'},
{duration: 1 * 1000, iterations: 2, direction: 'alternate'})); | |
| 43 | |
| 44 at(0.5 * 1000, function() { | |
| 45 assert_equals(0, target.style.length); | |
| 46 assert_equals('', target.style.left); | |
| 47 }); | |
| 48 | |
| 49 testharness_timeline.schedule(function() { | |
| 50 target.style.left = '50px'; | |
| 51 assert_styles(target, {left: '150px'}, 'getComputedStyle() should return corre
ct value after setting inline style.'); | |
| 52 }, 1000); | |
| 53 | |
| 54 at(1.5 * 1000, function() { | |
| 55 assert_equals(1, target.style.length); | |
| 56 assert_equals('50px', target.style.left); | |
| 57 }); | |
| 58 | |
| 59 testharness_timeline.schedule(function() { | |
| 60 target.style.cssText = 'left: 100px; background-color: green;'; | |
| 61 }, 2500); | |
| 62 | |
| 63 at(3 * 1000, function() { | |
| 64 assert_equals(2, target.style.length); | |
| 65 assert_equals('100px', target.style.left); | |
| 66 assert_not_equals('', target.style.backgroundColor); | |
| 67 }); | |
| 68 | |
| 69 </script> | |
| OLD | NEW |