Closed tonyg closed 3 months ago
Thank you!
Maybe nowadays we can simply use offsetX/Y
without checking? This code is ancient.
I think we could profitably remove the userAgent check - per https://caniuse.com/mdn-api_mouseevent_offsetx all current browsers support offsetX, but firefox 38 (hah) was released in 2015 (hah!) which isn't that (?) long ago so how about
This PR fixes a bug using squeak.js.org with current Firefox (98) on Android: when using touch events to simulate mouse interaction, the mouse ends up at 0@0 and never moves away.
Android Firefox (98, probably earlier too) is able to use
offsetX
/offsetY
in mouse events, despite not having "AppleWebKit" in its user agent string. This patch first tries checking for "AppleWebKit", as before, but if it is not found, delays a decision until later, when the event is checked for an actualoffsetX
field.