tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

autofocus-denied.https.html (952B)


      1 <!DOCTYPE html>
      2 <title>Autofocusing is blocked in a fenced frame</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="/common/dispatcher/dispatcher.js"></script>
      7 <script src="resources/utils.js"></script>
      8 
      9 <body>
     10 <script>
     11 promise_test(async () => {
     12  const frame = attachFencedFrameContext();
     13  let autofocusIsFocused = await frame.execute(async () => {
     14    let autofocusInput = document.createElement('input');
     15    autofocusInput.autofocus = true;
     16    document.body.appendChild(autofocusInput);
     17    await new Promise(resolve => requestAnimationFrame(resolve));
     18    return document.activeElement == autofocusInput;
     19  });
     20  assert_false(autofocusIsFocused, "<input autofocus> received focus");
     21 }, "Autofocusing is blocked on an element in a fenced frame as "+
     22     "it's treated like a cross-origin subframe.");
     23 </script>
     24 </body>
     25 </html>