tor-browser

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

resize-textarea-rtl-001.tentative.html (2136B)


      1 <!DOCTYPE html>
      2 <html dir="rtl">
      3 <title>Test of resizing interaction</title>
      4 <link rel="author" title="L. David Baron" href="https://dbaron.org/">
      5 <link rel="author" title="Google" href="http://www.google.com/">
      6 <link rel="help" href="https://www.w3.org/TR/css-ui-4/#resize">
      7 <link rel="help" href="https://issues.chromium.org/issues/41236895">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/resources/testdriver.js"></script>
     11 <script src="/resources/testdriver-actions.js"></script>
     12 <script src="/resources/testdriver-vendor.js"></script>
     13 
     14 <!--
     15  This test uses .tentative. because it depends on unspecified user
     16  interface characteristics (the position of the resizer UI and how it
     17  works), although those user interface characteristics are likely common
     18  across implementations.
     19 -->
     20 
     21 <textarea id="text"></textarea>
     22 
     23 <script>
     24 
     25 promise_test(async t => {
     26  let e = document.getElementById("text");
     27 
     28  let w = e.getBoundingClientRect().width;
     29  let h = e.getBoundingClientRect().height;
     30 
     31  let startX = e.getBoundingClientRect().left;
     32 
     33  let x = e.getBoundingClientRect().left + 3; // resizer at lower left
     34  let y = e.getBoundingClientRect().bottom - 3;
     35  let move1 = new test_driver.Actions()
     36    .pointerMove(x, y)
     37    .pointerDown()
     38    .pointerMove(x+2, y-3);
     39  await move1.send();
     40 
     41  assert_equals(e.getBoundingClientRect().width, w - 2, "width after move 1");
     42  assert_equals(e.getBoundingClientRect().height, h - 3, "height after move 1");
     43  assert_equals(e.getBoundingClientRect().left, startX + 2, "left after move 1");
     44 
     45  // It's odd that we have to send pointerMove and pointerDown again here.
     46  let move2 = new test_driver.Actions()
     47    .pointerMove(x+2, y-3)
     48    .pointerDown()
     49    .pointerMove(x-9, y-1)
     50    .pointerUp();
     51  await move2.send();
     52 
     53  assert_equals(e.getBoundingClientRect().width, w + 9, "width after move 2");
     54  assert_equals(e.getBoundingClientRect().height, h - 1, "height after move 2");
     55  assert_equals(e.getBoundingClientRect().left, startX - 9, "left after move 2");
     56 }, "resizing of RTL textarea in RTL context");
     57 
     58 </script>