w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 51 forks source link

Specify the field values for non-pointer `contextmenu` event #323

Open andreubotella opened 2 years ago

andreubotella commented 2 years ago

Back when the contextmenu event was defined in the HTML spec (see whatwg/html#7505 for context), it used the "fire a synthetic pointer event" algorithm for context menus opened via keyboard or other non-pointer input, as it does with non-pointer click events. This algorithm would set the event's button{,s} and {client,screen}{X,Y} fields to 0.

With the move of the contextmenu event to this spec, it is no longer clear what those fields should be set to for context menus not opened via pointer. And different browsers differ: Firefox sets button to 0, Chromium to -1, and WebKit (tested with GNOME Web on Linux) to 2. All browsers set buttons to 0, and they all seem to set {client,screen}{X,Y} to the coordinates where the context menu was opened.