tor-browser

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

document-activeelement.https.html (1209B)


      1 <!DOCTYPE html>
      2 <title>Test document.activeElement</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 <script src="/resources/testdriver.js"></script>
      9 <script src="/resources/testdriver-actions.js"></script>
     10 <script src="/resources/testdriver-vendor.js"></script>
     11 
     12 <body>
     13 <script>
     14 promise_test(async(t) => {
     15  const actions = new test_driver.Actions();
     16  const fencedframe = await attachFencedFrameContext();
     17 
     18  assert_equals(document.activeElement, document.body);
     19 
     20  await multiClick(0, 0, fencedframe.element, 5);
     21 
     22  assert_equals(document.activeElement, fencedframe.element);
     23 }, 'document.activeElement should be the fenced frame when it has focus');
     24 
     25 promise_test(async(t) => {
     26  const actions = new test_driver.Actions();
     27  const fencedframe = await attachFencedFrameContext();
     28 
     29  await fencedframe.execute(() => {
     30    assert_equals(document.activeElement, document.body);
     31  })
     32 
     33 }, "a fenced frame's document.activeElement should be its body when it " +
     34   "doesn't have focus");
     35 
     36 </script>
     37 </body>