tor-browser

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

radio-focus-navigation-disabled.html (1394B)


      1 <!DOCTYPE html>
      2 <link rel="author" href="mailto:dizhangg@chromium.org">
      3 <link rel="help" href="http://crbug.com/427520278">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 <script src="resources/focus-utils.js"></script>
     10 
     11 <form>
     12 <label><input type="radio" name="start" id="start">Outside form</label>
     13 </form>
     14 <form>
     15 <label><input type="radio" name="radio" id="a" disabled checked>disabled checked</label>
     16 <label><input type="radio" name="radio" id="b">enabled 1</label>
     17 <label><input type="radio" name="radio" id="c">enabled 2</label>
     18 </form>
     19 <form>
     20 <label><input type="radio" name="end" id="end">Outside form</label>
     21 </form>
     22 
     23 <script>
     24 
     25 promise_test(async () => {
     26    start.focus();
     27    assert_equals(document.activeElement, start);
     28    await navigateFocusForward();
     29    assert_equals(document.activeElement, b);
     30    await navigateFocusForward();
     31    assert_equals(document.activeElement, end);
     32    await navigateFocusBackward();
     33    assert_equals(document.activeElement, b);
     34    await navigateFocusBackward();
     35    assert_equals(document.activeElement, start);
     36 }, 'Should be able to tab focus in radio group even when the checked radio button is disabled.');
     37 </script>