| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 | 4 |
| 5 <div id="parent"></div> | 5 <div id="parent"></div> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 var keyframeValueMap = { | 8 var keyframeValueMap = { |
| 9 translate: '10px 10px 10px', | 9 translate: '10px 10px 10px', |
| 10 scale: '1 2 3', | 10 scale: '1 2 3', |
| 11 rotate: '45deg', | 11 rotate: '45deg', |
| 12 transform: 'translate(10px, 20px)', | 12 transform: 'translate(10px, 20px)', |
| 13 opacity: '1' | 13 opacity: '1' |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 /* Test that animation on compositableProperty on compositor is cancelled when | 16 /* Test that animation on compositableProperty on compositor is cancelled when |
| 17 cancelProperty is animated on the element */ | 17 cancelProperty is animated on the element */ |
| 18 function assertAnimationComposited(compositableProperty, cancelProperty, isStill
Composited) { | 18 function assertAnimationComposited(compositableProperty, cancelProperty, isStill
Composited) { |
| 19 var element = document.createElement('div'); | 19 var element = document.createElement('div'); |
| 20 // The element must have some painted content in order to be |
| 21 // composited when animated in SPv2. |
| 22 element.innerText = 'x'; |
| 20 document.getElementById('parent').appendChild(element); | 23 document.getElementById('parent').appendChild(element); |
| 21 | 24 |
| 22 var keyframe = {}; | 25 var keyframe = {}; |
| 23 keyframe[compositableProperty] = keyframeValueMap[compositableProperty]; | 26 keyframe[compositableProperty] = keyframeValueMap[compositableProperty]; |
| 24 | 27 |
| 25 var animation = element.animate([keyframe, keyframe], { | 28 var animation = element.animate([keyframe, keyframe], { |
| 26 duration: 4000, | 29 duration: 4000, |
| 27 iterations: Infinity | 30 iterations: Infinity |
| 28 }); | 31 }); |
| 29 | 32 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 assertAnimationComposited('scale', 'transform', false); | 80 assertAnimationComposited('scale', 'transform', false); |
| 78 assertAnimationComposited('scale', 'rotate', false); | 81 assertAnimationComposited('scale', 'rotate', false); |
| 79 assertAnimationComposited('scale', 'scale', false); | 82 assertAnimationComposited('scale', 'scale', false); |
| 80 assertAnimationComposited('scale', 'translate', false); | 83 assertAnimationComposited('scale', 'translate', false); |
| 81 | 84 |
| 82 assertAnimationComposited('opacity', 'transform', true); | 85 assertAnimationComposited('opacity', 'transform', true); |
| 83 assertAnimationComposited('opacity', 'translate', true); | 86 assertAnimationComposited('opacity', 'translate', true); |
| 84 assertAnimationComposited('opacity', 'rotate', true); | 87 assertAnimationComposited('opacity', 'rotate', true); |
| 85 assertAnimationComposited('opacity', 'scale', true); | 88 assertAnimationComposited('opacity', 'scale', true); |
| 86 </script> | 89 </script> |
| OLD | NEW |