zero-duration-multiple-transition.html (951B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <link rel="help" href="https://drafts.csswg.org/css-transitions/#starting"> 4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1461070"> 5 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <style> 9 #t { 10 color: red; 11 transition-property: color, color; 12 transition-duration: 1s, 0s; 13 } 14 </style> 15 <div id="t"></div> 16 <script> 17 test(function() { 18 let div = document.getElementById("t"); 19 assert_equals(getComputedStyle(div).color, "rgb(255, 0, 0)"); 20 21 div.style.color = "green"; 22 assert_equals( 23 div.getAnimations().length, 24 0, 25 "No transition should've started" 26 ); 27 28 assert_equals(getComputedStyle(div).color, "rgb(0, 128, 0)"); 29 }, "transition-duration of 0 prevents earlier transitions with the same property from starting."); 30 </script>