tor-browser

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

first.html (797B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>The first autofocus in the document wins</title>
      4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#autofocusing-a-form-control:-the-autofocus-attribute">
      5 <link rel="author" title="Domenic Denicola" href="d@domenic.me">
      6 
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <script src="resources/utils.js"></script>
     10 
     11 <input autofocus>
     12 <input autofocus>
     13 
     14 <script>
     15 "use strict";
     16 
     17 promise_test(async () => {
     18  const [input1, input2] = document.querySelectorAll("input");
     19 
     20  await waitUntilStableAutofocusState();
     21  assert_equals(document.activeElement, input1);
     22  assert_not_equals(document.activeElement, input2);
     23 }, 'The first autofocus element in the document should win.');
     24 </script>