focusring-2.html (1057B)
1 <!DOCTYPE HTML> 2 <html class="reftest-wait"><head> 3 <meta charset="utf-8"> 4 <title>Testcase #2 for bug 1253977</title> 5 <style type="text/css"> 6 7 * { -moz-appearance:none; } 8 :focus { 9 border:2px solid black; 10 } 11 :-moz-focusring { 12 outline: 2px dashed black; 13 } 14 15 </style> 16 </head> 17 <body> 18 19 <select onfocus="continueTest1()" onblur="continueTest2()"><option>1<option>2</select> 20 21 <script> 22 23 function continueTest2(){ 24 var s = document.querySelector("select"); 25 setTimeout(function(){ s.style.display = 'inline'; document.body.offsetHeight; }, 4); 26 setTimeout(function(){ document.body.offsetHeight; document.documentElement.removeAttribute("class"); }, 100); 27 } 28 29 function continueTest1(){ 30 var s = document.querySelector("select"); 31 setTimeout(function(){ s.style.display = 'none'; }, 2); 32 setTimeout(function(){ s.blur(); document.body.offsetHeight; }, 3); 33 } 34 35 function runTests(){ 36 var s = document.querySelector("select"); 37 s.focus(); 38 } 39 40 window.focus(); 41 window.addEventListener("MozReftestInvalidate", runTests); 42 43 </script> 44 45 </body> 46 </html>