zoom-to-focus-input-oopif-ref.html (890B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <meta name="viewport" content="width=device-width"> 4 <style> 5 iframe { 6 position: absolute; 7 width: 1600px; 8 height: 2000px; 9 top: 200px; 10 left: 100px; 11 } 12 </style> 13 <iframe src="zoom-to-focus-input-subframe.html"></iframe> 14 <script> 15 document.addEventListener('MozReftestInvalidate', async () => { 16 const transformEndPromise = new Promise(resolve => { 17 SpecialPowers.Services.obs.addObserver(function observer() { 18 SpecialPowers.Services.obs.removeObserver(observer, "APZ:TransformEnd"); 19 resolve(); 20 }, "APZ:TransformEnd"); 21 }); 22 23 const iframe = document.querySelector("iframe"); 24 const input = iframe.contentDocument.querySelector("input"); 25 input.focus(); 26 SpecialPowers.DOMWindowUtils.zoomToFocusedInput(); 27 28 await transformEndPromise; 29 30 document.documentElement.classList.remove('reftest-wait'); 31 }); 32 </script> 33 </html>