bug956530-1-ref.html (820B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <style> 4 /* eliminate the blue glow when focusing the element. */ 5 input { 6 background: none; 7 border: none; 8 outline: none; 9 } 10 </style> 11 <script src="/tests/SimpleTest/SimpleTest.js"></script> 12 <script> 13 async function test() { 14 let input = document.querySelector("input"); 15 let waitForFocus = new Promise(resolve => { 16 input.addEventListener("focus", resolve, {once: true}); 17 }); 18 window.focus(); 19 input.focus(); 20 await waitForFocus; 21 input.select(); 22 await new Promise(resolve => { SimpleTest.executeSoon(resolve); }); 23 document.documentElement.removeAttribute("class"); 24 } 25 </script> 26 <body onload="SimpleTest.executeSoon(test);"> 27 <input value="text text text text text"> 28 </body> 29 </html>