focus-handling.html (955B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <!-- In this case we're using reftest-wait to make sure the test doesn't 4 get snapshotted before it's been focused. We're not testing 5 invalidation so we don't need to listen for MozReftestInvalidate. 6 --> 7 <head> 8 <meta charset="utf-8"> 9 <script> 10 function begin() { 11 setTimeout(function() { 12 document.getElementsByTagName('input')[1].focus(); 13 }, 0); 14 } 15 16 function end() { 17 setTimeout(function() { 18 document.documentElement.className = ""; 19 }, 0); 20 } 21 </script> 22 </head> 23 <body> 24 <input type='number' autofocus onfocus="begin();" 25 style="appearance:none;"><br> 26 <input type='number' onfocus="end();" 27 style="appearance:none;"> 28 <!-- div to cover spin box area for type=number to type=text comparison --> 29 <div style="display:block; position:absolute; background-color:black; width:200px; height:100px; top:0px; left:100px;"> 30 </body> 31 </html>