blob: f5c2e702e5783e3f9067c7735ab02f905d3de69b [file] [log] [blame]
Emilio Cobos Álvarez12d66ce2020-08-14 19:09:391<!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>
19async_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>