select-event-drag-remove.html (1106B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>Drag select triggers the right event, and doesn't crash if it removes the target while at it</title> 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 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1386418"> 10 <style> 11 input { 12 border: 0; 13 padding: 0; 14 font: 16px/1 monospace; 15 } 16 </style> 17 <input type="text" value="Drag select to crash"> 18 <script> 19 async_test(t => { 20 let input = document.querySelector("input"); 21 input.addEventListener("select", t.step_func(function() { 22 input.remove(); 23 requestAnimationFrame(() => requestAnimationFrame(() => t.done())); 24 })); 25 new test_driver.Actions() 26 .pointerMove(0, 0, { origin: input }) 27 .pointerDown() 28 .pointerMove(40, 0, { origin: input }) 29 .pointerUp() 30 .send(); 31 }, "Drag and remove from the select event doesn't crash"); 32 </script>