diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /remote/test/puppeteer/test/assets/input/touchscreen.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'remote/test/puppeteer/test/assets/input/touchscreen.html')
-rw-r--r-- | remote/test/puppeteer/test/assets/input/touchscreen.html | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/remote/test/puppeteer/test/assets/input/touchscreen.html b/remote/test/puppeteer/test/assets/input/touchscreen.html new file mode 100644 index 0000000000..76e31c97f9 --- /dev/null +++ b/remote/test/puppeteer/test/assets/input/touchscreen.html @@ -0,0 +1,122 @@ +<!doctype html> +<html> + <head> + <title>Touch test</title> + </head> + + <body> + <style> + button { + box-sizing: border-box; + position: absolute; + left: 0; + top: 0; + width: 10px; + height: 10px; + padding: 0; + margin: 0; + } + </style> + <button>Click target</button> + <script> + var allEvents = []; + globalThis.addEventListener( + "touchstart", + (event) => { + allEvents.push({ + type: "touchstart", + touches: [...event.changedTouches].map((touch) => [ + touch.clientX, + touch.clientY, + touch.radiusX, + touch.radiusY, + ]), + }); + }, + true, + ); + globalThis.addEventListener( + "touchmove", + (event) => { + allEvents.push({ + type: "touchmove", + touches: [...event.changedTouches].map((touch) => [ + touch.clientX, + touch.clientY, + touch.radiusX, + touch.radiusY, + ]), + }); + }, + true, + ); + globalThis.addEventListener( + "touchend", + (event) => { + allEvents.push({ + type: "touchend", + touches: [...event.changedTouches].map((touch) => [ + touch.clientX, + touch.clientY, + touch.radiusX, + touch.radiusY, + ]) + }); + }, + true, + ); + globalThis.addEventListener( + "pointerdown", + (event) => { + allEvents.push({ + type: "pointerdown", + x: event.x, + y: event.y, + width: event.width, + height: event.height, + }); + }, + true, + ); + globalThis.addEventListener( + "pointermove", + (event) => { + allEvents.push({ + type: "pointermove", + x: event.x, + y: event.y, + width: event.width, + height: event.height, + }); + }, + true, + ); + globalThis.addEventListener( + "pointerup", + (event) => { + allEvents.push({ + type: "pointerup", + x: event.x, + y: event.y, + width: event.width, + height: event.height, + }); + }, + true, + ); + globalThis.addEventListener( + "click", + (event) => { + allEvents.push({ + type: "click", + x: event.x, + y: event.y, + width: event.width, + height: event.height, + }); + }, + true, + ); + </script> + </body> +</html> |