summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/test/assets/input/touchscreen.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /remote/test/puppeteer/test/assets/input/touchscreen.html
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.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.html148
1 files changed, 49 insertions, 99 deletions
diff --git a/remote/test/puppeteer/test/assets/input/touchscreen.html b/remote/test/puppeteer/test/assets/input/touchscreen.html
index 76e31c97f9..b3a51e7f91 100644
--- a/remote/test/puppeteer/test/assets/input/touchscreen.html
+++ b/remote/test/puppeteer/test/assets/input/touchscreen.html
@@ -1,10 +1,10 @@
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
<title>Touch test</title>
</head>
- <body>
+ <body style="touch-action: none">
<style>
button {
box-sizing: border-box;
@@ -20,103 +20,53 @@
<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,
- );
+ for (const name of ["touchstart", "touchmove", "touchend"]) {
+ globalThis.addEventListener(
+ name,
+ (event) => {
+ allEvents.push({
+ type: name,
+ changedTouches: [...event.changedTouches].map((touch) => ({
+ clientX: touch.clientX,
+ clientY: touch.clientY,
+ radiusX: touch.radiusX,
+ radiusY: touch.radiusY,
+ force: touch.force,
+ })),
+ activeTouches: [...event.touches].map((touch) => ({
+ clientX: touch.clientX,
+ clientY: touch.clientY,
+ radiusX: touch.radiusX,
+ radiusY: touch.radiusY,
+ force: touch.force,
+ })),
+ });
+ },
+ true,
+ );
+ }
+ for (const name of ['pointerdown', 'pointermove', 'pointerup', 'click']) {
+ globalThis.addEventListener(
+ name,
+ (event) => {
+ allEvents.push({
+ type: name,
+ x: event.x,
+ y: event.y,
+ width: event.width,
+ height: event.height,
+ altitudeAngle: event.altitudeAngle,
+ azimuthAngle: event.azimuthAngle,
+ pressure: event.pressure,
+ pointerType: event.pointerType,
+ twist: event.twist,
+ tiltX: event.tiltX,
+ tiltY: event.tiltY,
+ });
+ },
+ true,
+ );
+ }
</script>
</body>
</html>