offsetRotate.html (1452B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <div id='container'> 5 <div id='element'></div> 6 </div> 7 <script> 8 9 var container = document.getElementById('container'); 10 var element = document.getElementById('element'); 11 12 test(function() { 13 var keyframes = [ 14 {offsetRotate: 'inherit'}, 15 {offsetRotate: 'auto 200deg'} 16 ]; 17 18 container.style.offsetRotate = 'auto 100deg'; 19 var player = element.animate(keyframes, 10); 20 21 player.pause(); 22 player.currentTime = 5; 23 assert_equals(getComputedStyle(element).offsetRotate, 'auto 150deg'); 24 25 container.style.offsetRotate = '400deg'; 26 assert_equals(getComputedStyle(element).offsetRotate, 'auto 200deg'); 27 28 container.style.offsetRotate = '400deg auto'; 29 assert_equals(getComputedStyle(element).offsetRotate, 'auto 300deg'); 30 31 container.style.offsetRotate = '800deg auto'; 32 assert_equals(getComputedStyle(element).offsetRotate, 'auto 500deg'); 33 34 container.style.offsetRotate = '400deg'; 35 assert_equals(getComputedStyle(element).offsetRotate, 'auto 200deg'); 36 37 container.style.offsetRotate = '800deg auto'; 38 assert_equals(getComputedStyle(element).offsetRotate, 'auto 500deg'); 39 40 container.style.offsetRotate = '400deg auto'; 41 assert_equals(getComputedStyle(element).offsetRotate, 'auto 300deg'); 42 }, 'offsetRotate responsive to inherited offsetRotate changes'); 43 </script>