Bug 253416
| Summary: | Clicks aren't registered in iOS Safari in Wasm game | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | eri0onpm |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dino, eknoor, karlcow, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari 16 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 16 | ||
| URL: | https://ericoporto.github.io/agsjs/fix/ | ||
eri0onpm
https://ericoporto.github.io/agsjs/fix/
The game in this link register touches correctly in Google Chrome on Android and also Firefox on Android, but not on Safari on iOS.
There is no exceptions or errors registered in the Safari console.
As far as I can tell the touch events should work the same in iOS Safari.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/106621669>
eri0onpm
I am using regular Emscripten methods, but I know their CI only tests for Chromium and Firefox, so my guess is there's some incompatibility between that and Safari, or some missing API in Safari. Any help in figuring this out would be greatly appreciated.
eri0onpm
Found the issue, Touch.identifier works differently in iOS Safari and there was some internal reliance on how it works on the other devices, os and browsers.
Eknoor
Thank you for the update on your findings. Does this report still need to remain open?
Karl Dubost
eri0onpm,
Are you referring to the code in this script:
in https://ericoporto.github.io/agsjs/fix/ags.js
I loaded the game on iPad (large) and it's not working at all.
> Touch.identifier works differently in iOS Safari
In which way? Could you provide a minimal test case?
https://w3c.github.io/touch-events/#dom-touch-identifier
> An identification number for each touch point.
>
> When a touch point becomes active, it must be assigned an identifier that is distinct from any other active touch point. While the touch point remains active, all events that refer to it must assign it the same identifier.
eri0onpm
sorry, I never saw the last message, but yes, it was fixed on our end, here is the PR that fixed this
https://github.com/adventuregamestudio/ags/pull/1955
The touch finger IDs in iOS they always get a new integer number, in Android browsers they work differently, being first finger the number 0, second finger on screen the number 1, and when a finger is removed from screen the next finger will get its ID or whatever is the lower available ID. Both comply with the spec for the Web as the way this is phrased in the spec is mostly "have an unique ID for a finger".