tor-browser

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

resize-textarea-rtl-002.tentative.html (2150B)


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