test_transitions_bug537151.html (1109B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=537151 5 --> 6 <head> 7 <title>Test for Bug 537151</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 <style type="text/css"> 11 12 #display { 13 transition: margin-left 200ms; 14 } 15 16 </style> 17 </head> 18 <body> 19 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=537151">Mozilla Bug 537151</a> 20 <p id="display">Paragraph</p> 21 <pre id="test"> 22 <script type="application/javascript"> 23 24 /** Test for Bug 537151 */ 25 26 SimpleTest.waitForExplicitFinish(); 27 SimpleTest.requestFlakyTimeout("untriaged"); 28 29 var p = document.getElementById("display"); 30 p.addEventListener("transitionend", listener); 31 var ignored = getComputedStyle(p, "").marginLeft; 32 p.style.marginLeft = "150px"; 33 34 var event_count = 0; 35 function listener(event) 36 { 37 ++event_count; 38 setTimeout(finish, 400); 39 p.style.color = "blue"; 40 } 41 42 function finish() 43 { 44 is(event_count, 1, "should have gotten only 1 transitionend event"); 45 SimpleTest.finish(); 46 } 47 48 </script> 49 </pre> 50 </body> 51 </html>