transition-computed.html (1598B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Transitions: getComputedStyle().transition</title> 6 <link rel="help" href="https://drafts.csswg.org/css-transitions/#transition-shorthand-property"> 7 <meta name="assert" content="transition computed value is as specified."> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/css/support/computed-testcommon.js"></script> 11 </head> 12 <body> 13 <div id="target"></div> 14 <script> 15 // <single-transition> = [ none | <single-transition-property> ] || 16 // <time> || <easing-function> || <time> 17 18 test(() => { 19 assert_equals(getComputedStyle(document.getElementById('target')).transition, "all"); 20 }, "Default transition value"); 21 22 test_computed_value("transition", "1s"); 23 test_computed_value("transition", "cubic-bezier(0, -2, 1, 3)"); 24 test_computed_value("transition", "1s -3s"); 25 test_computed_value("transition", "none"); 26 test_computed_value("transition", "top"); 27 28 test_computed_value("transition", "1s -3s cubic-bezier(0, -2, 1, 3) top", "top 1s cubic-bezier(0, -2, 1, 3) -3s"); 29 test_computed_value("transition", "1s -3s, cubic-bezier(0, -2, 1, 3) top", "1s -3s, top cubic-bezier(0, -2, 1, 3)"); 30 31 test_computed_value("transition", "all, all"); 32 33 test(() => { 34 const target = document.getElementById('target'); 35 target.style.transition = "initial"; 36 target.style.transitionDelay = "1s"; 37 assert_equals(getComputedStyle(target).transition, "0s 1s"); 38 }, "Transition with a delay but no duration"); 39 40 // TODO: Add test with a single timing-function keyword. 41 </script> 42 </body> 43 </html>