KeyframeEffect-getKeyframes-width-and-height-transition.tentative.html (1337B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>AnimationEffect.getKeyframes() for CSS transitions of the width and height properties</title> 4 <link rel="help" href="https://drafts.csswg.org/css-transitions-2/#csstransition"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="support/helper.js"></script> 8 <style> 9 10 .animated-div { 11 width: 100px; 12 height: 100px; 13 } 14 15 </style> 16 <div id="log"></div> 17 <script> 18 19 'use strict'; 20 21 test(t => { 22 const div = addDiv(t, { class: 'animated-div' }); 23 div.style.transition = 'width 10s'; 24 getComputedStyle(div).width; 25 div.style.width = '200px'; 26 27 const keyframes = div.getAnimations()[0].effect.getKeyframes(); 28 assert_equals(keyframes[0].width, "100px", 'from keyframe value'); 29 assert_equals(keyframes[1].width, "200px", 'to keyframe value'); 30 }, 'getKeyframes() output for a width transition'); 31 32 test(t => { 33 const div = addDiv(t, { class: 'animated-div' }); 34 div.style.transition = 'height 10s'; 35 getComputedStyle(div).height; 36 div.style.height = '200px'; 37 38 const keyframes = div.getAnimations()[0].effect.getKeyframes(); 39 assert_equals(keyframes[0].height, "100px", 'from keyframe value'); 40 assert_equals(keyframes[1].height, "200px", 'to keyframe value'); 41 }, 'getKeyframes() output for a height transition'); 42 43 </script>