Created attachment 403513 [details]
Reduced test case for contextmenu event
Safari mobile (on iOS) doesn't fire the "contextmenu" event on elements, and therefore doesn't allow easy integration of html custom context menus.
When using addEventListener('contextmenu') on an element, by default the magnifier is always fired (even if the element doesn't have any text content). When using "-webkit-user-select: none" and "user-select: none", the magnifier is disabled - though the contextmenu event isn't fired anyhow.
The attachment is a reduced test case, where other browsers on other operating systems will behave like expected, and a long-press on mobile (or right click on desktop) of an element leads to the rectangle turning green. Only WebKit/Safari on iOS seems to not allow contextmenu events.
AX: contextmenu event fired on Mac (w/VoiceOver) but not iOS (w/VoiceOver)
On iOS, there are accessibility-triggered ways to show context menus in native UI: Home Screen icons for example. VoiceOver's default gesture for this is single-finger triple-tap. It used to be long-press, as mentioned by "cookiengineer" (no relation). The iOS VO key press is the same as Mac: VO+Shift+M. Yet neither of these trigger in Safari or other WebKit views.
I don't think this is purely an accessibility issue. As far as I am aware, there is no mainstream UI way to trigger a `contextmenu` event in iOS WebKit. As such, we should not add an accessibility-only way to trigger this event, as it could reveal the use of assistive technology.
Perhaps this bug should be blocked on a new WebKit issue to support `contextmenu` with a mainstream gesture or keypress if appropriate. (Disclaimer: I have not fully considered the implications, so there may be unexpected downsides.)
Update, contextmenu is triggered with right-click/ctrl-click when a BT mouse is connected to iPad.
"contextmenu" is not just about menus, but it is a convenient way to detect longpress on Android devices. Without it we have to use a combination of timeout hacks on pointerstart, pointerend, pointercancel, pointermove and whatnot. Would be great if iOS supported it.