tor-browser

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

mousedown-move-inner-when-dragging-1.html (1160B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/resources/testdriver.js"></script>
      5 <script src="/resources/testdriver-vendor.js"></script>
      6 <script src="/resources/testdriver-actions.js"></script>
      7 <head>
      8 <title>Test dragging still occurs when mousedown moves the inner element</title>
      9 </head>
     10 <body>
     11 <div id="element" draggable="true" style="width: 40px; height: 40px; background-color:red;">
     12  <div id="inner" style="width: 30px; height: 30px; background-color:black;"></div>
     13 </div>
     14 
     15 <div id="element2"></div>
     16 <script>
     17 
     18 promise_test(function() {
     19  return new Promise(r => {
     20    element.addEventListener("dragstart", function(e) {
     21      assert_equals(e.target, element);
     22      r();
     23    });
     24 
     25    element.addEventListener("mousedown", function() {
     26      element2.appendChild(inner);
     27    });
     28 
     29    new test_driver.Actions()
     30    .pointerMove(0, 0, {origin: inner})
     31    .pointerDown()
     32    .pointerMove(10, 10, {origin:inner})
     33    .pointerUp()
     34    .send();
     35  });
     36 }, "dragstart should still fire when the mousedown event moves the inner element around");
     37 </script>
     38 </body>
     39 </html>