focusring-2.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * { -moz-appearance:none; }
  7. :focus {
  8. border:2px solid black;
  9. }
  10. :-moz-focusring {
  11. outline: 2px dashed black;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <select onfocus="continueTest1()" onblur="continueTest2()"><option>1<option>2</select>
  17. <script>
  18. function continueTest2(){
  19. var s = document.querySelector("select");
  20. setTimeout(function(){ s.style.display = 'inline'; document.body.offsetHeight; }, 4);
  21. setTimeout(function(){ document.body.offsetHeight; document.documentElement.removeAttribute("class"); }, 100);
  22. }
  23. function continueTest1(){
  24. var s = document.querySelector("select");
  25. setTimeout(function(){ s.style.display = 'none'; }, 2);
  26. setTimeout(function(){ s.blur(); document.body.offsetHeight; }, 3);
  27. }
  28. function runTests(){
  29. var s = document.querySelector("select");
  30. s.focus();
  31. }
  32. window.focus();
  33. window.addEventListener("MozReftestInvalidate", runTests, false);
  34. </script>
  35. </body>
  36. </html>