WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
282988
iOS Safari "click" events have the "mouse" pointerType when triggered from touch
https://bugs.webkit.org/show_bug.cgi?id=282988
Summary
iOS Safari "click" events have the "mouse" pointerType when triggered from touch
zallen
Reported
2024-11-12 08:31:08 PST
Safari 18.2 switched from using mouse events to pointer events for click events. However these click events are using the incorrect pointerType by reporting touches as a mouse. Steps to reproduce: On iOS Safari 18.2, use touch to tap on the "Target" box on
https://codepen.io/zeallen/pen/ExqrgjB
. Notice: * pointerdown and pointerup both report "touch" as the pointerType (correct) * click reports "mouse" as the pointerType (incorrect)
Attachments
Add attachment
proposed patch, testcase, etc.
Abrar Rahman Protyasha
Comment 1
2024-11-12 18:44:16 PST
Thanks for the bug report! About click events, the PointerEvent spec says:
> If the events are generated by a pointing device, their pointerId and pointerType MUST be the same as the PointerEvents that caused these events.
https://w3c.github.io/pointerevents/#dfn-click-auxclick-and-contextmenu-events:~:text=If%20the%20events%20are%20generated%20by%20a%20pointing%20device%2C%20their%20pointerId%20and%20pointerType%20MUST%20be%20the%20same%20as%20the%20PointerEvents%20that%20caused%20these%20events
. We should fix this.
Radar WebKit Bug Importer
Comment 2
2024-11-13 14:02:50 PST
<
rdar://problem/139828481
>
Sam Sneddon [:gsnedders]
Comment 3
2024-11-14 20:13:53 PST
What led to you finding this, if I may ask? Because, e.g., if your website has places where behaviour differs based on the pointerType of the click event (and expecting a certain degree of fine control if it is a mouse), then there's almost certainly other breakage out there.
zallen
Comment 4
2024-11-15 07:28:10 PST
My website had some special handling for clicks in one area due to touch not having the ability to hover, so the behavior with a mouse vs touch/pen differed. I was using the pointerType of the click event to determine what behavior to do, but I had special handling for Safari since, prior to 18.2, click events were mouse events instead of pointer events. Now that 18.2 uses pointer events, that special handling stopped being engaged, which led to incorrect behavior.
Abrar Rahman Protyasha
Comment 5
2025-01-13 18:59:24 PST
Pull request:
https://github.com/WebKit/WebKit/pull/38976
EWS
Comment 6
2025-01-14 11:31:45 PST
Committed
288873@main
(d1f55d9bf83b): <
https://commits.webkit.org/288873@main
> Reviewed commits have been landed. Closing PR #38976 and removing active labels.
Abrar Rahman Protyasha
Comment 7
2025-02-06 16:33:29 PST
Reopened Bugzilla. REGRESSION (
288873@main
): [ iOS ] fast/forms/switch/click-animation-twice-fast.html is a constant timeout., tracking revert in
https://bugs.webkit.org/show_bug.cgi?id=287098
.
Abrar Rahman Protyasha
Comment 8
2025-02-13 16:07:31 PST
rdar://144822509
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug