tor-browser

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

active-onblur.html (1225B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
      4 <link rel="help" href="http://crbug.com/945854">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/testdriver.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 
     11 <!-- This behavior is not explicitly specified. -->
     12 
     13 <button id=b1>button one</button>
     14 <button id=b2>button two</button>
     15 
     16 <script>
     17 promise_test(async () => {
     18  b1.focus();
     19 
     20  // Hold spacebar down
     21  await (new test_driver.Actions()).keyDown('\uE00D').send();
     22  assert_equals(document.querySelector(':active'), b1,
     23    'Buttons should be :active while the spacebar is pressed down.');
     24 
     25  // Press tab
     26  await (new test_driver.Actions()).keyDown('\uE004').keyUp('\uE004').send();
     27  assert_equals(document.querySelector(':active'), null,
     28    'Buttons should not be :active after tab is used to change focus.');
     29 
     30  // Release spacebar
     31  await (new test_driver.Actions()).keyUp('\uE00D').send();
     32 }, 'Buttons should clear :active when the user tabs away from them while holding spacebar.');
     33 </script>