w3c / uievents

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

The order in which the `contextmenu` `auxclick` event is triggered #285

Open mantou132 opened 3 years ago

mantou132 commented 3 years ago

https://codepen.io/mantou132/pen/NWNGPJL

When the right mouse button is clicked, the contextmenu auxclick event will be triggered.

But the trigger sequence is inconsistent in chrome and Firefox:

// macOS Firefox: auxclick , contextmenu Chrome: contextmenu, auxclick

saschanaz commented 3 years ago

Chrome on Windows fires auxclick before contextmenu as Firefox does. Perhaps a platform dependent bug from Chrome?

masayuki-nakano commented 3 years ago

On Linux, both Firefox and Chrome fire contextmenu -> auxclick.

masayuki-nakano commented 3 years ago

On Windows and macOS, a native event notifies applications of context menu open. It seems that GTK on Linux does not have it.

And whether context menu should be opened at mousedown or mouseup depends on the platform manner. So, it might be difficult to consider the order. https://searchfox.org/mozilla-central/rev/31ddf859c57e812878a5f817e4097efb06de4d97/modules/libpref/init/StaticPrefList.yaml#9965-9971