tor-browser

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

css-table.html (1907B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: focusgroup - Validate that Focusgroup works with CSS tables too.</title>
      4 <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
      5 <link rel="help" href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Focusgroup/explainer.md">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="/resources/testdriver.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 <script src="/resources/testdriver-actions.js"></script>
     11 <script src="../resources/focusgroup-utils.js"></script>
     12 
     13 <div style="display:table" focusgroup=grid>
     14  <div style="display:table-row">
     15    <div id=r1c1 style="display:table-cell" tabindex=0>r1c1</div>
     16    <div id=r1c2 style="display:table-cell" tabindex=0>r1c2</div>
     17  </div>
     18  <div style="display:table-row">
     19    <div id=r2c1 style="display:table-cell" tabindex=0>r2c1</div>
     20    <div id=r2c2 style="display:table-cell" tabindex=0>r2c2</div>
     21  </div>
     22 </div>
     23 
     24 <script>
     25  promise_test(async t => {
     26    var r1c1 = document.getElementById("r1c1");
     27    var r1c2 = document.getElementById("r1c2");
     28    var r2c1 = document.getElementById("r2c1");
     29    var r2c2 = document.getElementById("r2c2");
     30 
     31    await focusAndKeyPress(r1c1, kArrowRight);
     32    assert_equals(document.activeElement, r1c2);
     33 
     34    await focusAndKeyPress(r1c2, kArrowDown);
     35    assert_equals(document.activeElement, r2c2);
     36 
     37    await focusAndKeyPress(r2c2, kArrowLeft);
     38    assert_equals(document.activeElement, r2c1);
     39 
     40    await focusAndKeyPress(r2c1, kArrowUp);
     41    assert_equals(document.activeElement, r1c1);
     42  }, "Tests that grid focusgroups also work on CSS tables (i.e.: 'display: table'). The implementation relies on the layout objects, so the other tests that covers HTML tables don't need to be duplicated to test the same cases with CSS tables.");
     43 
     44 </script>