| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 @keyframes anim-missing-from { to { width: 200px; height: 200px; } } |
| 6 @keyframes anim-missing-to { from { left: 100px; } } |
| 7 @keyframes anim-missing-both { 50% { background-color: rgb(200, 100, 40); } } |
| 8 |
| 9 .target-before { |
| 10 width: 100px; |
| 11 height: 100px; |
| 12 background-color: rgb(0, 0, 0); |
| 13 left: 20px; |
| 14 } |
| 15 |
| 16 .target-after { |
| 17 width: 600px; |
| 18 height: 300px; |
| 19 background-color: rgb(120, 160, 200); |
| 20 left: 200px; |
| 21 } |
| 22 |
| 23 #target1 { animation: anim-missing-from 4s -1s linear paused; } |
| 24 #target2 { animation: anim-missing-to 4s -1s linear paused; } |
| 25 #target3 { animation: anim-missing-both 4s -1s linear paused; } |
| 26 #target4 { animation: anim-missing-both 0.2s 2 linear paused forwards; } |
| 27 |
| 28 </style> |
| 29 <div id="target1" class="target-before"></div> |
| 30 <div id="target2" class="target-before"></div> |
| 31 <div id="target3" class="target-before"></div> |
| 32 <div id="target4" class="target-before"></div> |
| 33 <script> |
| 34 var async1 = async_test("Iteration event fires in running animation"); |
| 35 var async2 = async_test("Neutral keyframe updates during animation style updat
e"); |
| 36 |
| 37 test(function() { |
| 38 assert_equals(parseInt(getComputedStyle(target1).width), 125); |
| 39 assert_equals(parseInt(getComputedStyle(target1).height), 125); |
| 40 target1.className = 'target-after'; |
| 41 assert_equals(parseInt(getComputedStyle(target1).width), 500); |
| 42 assert_equals(parseInt(getComputedStyle(target1).height), 275); |
| 43 |
| 44 assert_equals(parseInt(getComputedStyle(target2).left), 80); |
| 45 target2.className = 'target-after'; |
| 46 assert_equals(parseInt(getComputedStyle(target2).left), 125); |
| 47 |
| 48 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(100, 50, 20)')
; |
| 49 target3.className = 'target-after'; |
| 50 assert_equals(getComputedStyle(target3).backgroundColor, 'rgb(160, 130, 120)
'); |
| 51 |
| 52 target4.style.animationPlayState = 'running'; |
| 53 |
| 54 target4.addEventListener('animationiteration', function() { |
| 55 target4.className = 'target-after'; |
| 56 async1.done(); |
| 57 }); |
| 58 |
| 59 target4.addEventListener('animationend', function() { |
| 60 assert_equals(getComputedStyle(target4).backgroundColor, 'rgb(120, 160,
200)'); |
| 61 async2.done(); |
| 62 }); |
| 63 |
| 64 }, "Check that neutral keyframes are responsive to underlying style changes"); |
| 65 </script> |
| OLD | NEW |