Bug 166849

Summary: Consider implementing auxclick event
Product: WebKit Reporter: Navid <nzolghadr>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: cdumez, darin, dave+webkit, rniwa
Priority: P2    
Version: Other   
Hardware: All   
OS: All   

Navid
Reported 2017-01-09 10:20:18 PST
There was a new event proposed for non-primary button click actions called "auxclick" [1] and to dedicate the "click" event only to the primary button. Both FireFox[2] and Chrome[3] shipped the feature. I was wondering if it is possible to have it implemented in WebKit as well. [1] https://wicg.github.io/auxclick/ [2] https://hg.mozilla.org/mozilla-central/rev/ea7338a0b3de [3] https://www.chromestatus.com/feature/5663174342737920 P.S. I wasn't sure if the component is correct or not. So I just picked the one that seems closest. Feel free to change the component to a more appropriate one.
Attachments
David Tapuska
Comment 1 2017-01-09 10:29:15 PST
@cdumez: Chris do you have any position on this request?
Chris Dumez
Comment 2 2017-01-09 10:49:52 PST
Seems reasonable to me, especially if Firefox / Chrome already shipped this.
Chris Dumez
Comment 3 2017-01-09 16:47:26 PST
I tested the feature on Mac using: - https://jsfiddle.net/ejxer8tt/2/ Firefox nightly does alert "auxclick" on two-finger click. However, it did not on Chrome Canary for some reason. I also tested with a PC mouse (which is less common on Mac) and I got the same results when click the right button. Seems Chrome may not support this on Mac?
Chris Dumez
Comment 4 2017-01-09 16:54:57 PST
It also seems there are some backward-compatibility risks involved since we would stop firing regular "click" events of non-LeftButton clicks, something existing content may rely on.
Chris Dumez
Comment 5 2017-01-09 17:00:30 PST
(In reply to comment #4) > It also seems there are some backward-compatibility risks involved since we > would stop firing regular "click" events of non-LeftButton clicks, something > existing content may rely on. Hmm, actually https://jsfiddle.net/ejxer8tt/6/ seems to show that Safari was not fixing "click" events on right clicks anyway.
Navid
Comment 6 2017-01-09 17:00:59 PST
I double checked with Chrome. The reason you don't see this on Chrome is due to contextmenu. Context menu on Mac opens after down and so it prevents the page from seeing mouseup and then the click/auxclick. FF as oppose to Chrome does not consider the context menu as something that covers the whole page and consumes all the events. Anyhow, beside that difference in contextmenu which I'm not sure if we can solve as part of the auxclick, Chrome does send auxclick when the page receives both down and up for a non-primary button. You can see this by preventDefaulting the contextmenu event like as I did here: https://jsfiddle.net/ejxer8tt/3/ It worked both for the two finger click on the touch pad or for a PC mouse (middle and right buttons) connected to a Mac.
Navid
Comment 7 2017-01-16 10:53:56 PST
@Chris, did what I say address your concern? Does the proposal/spec look reasonable?
Alexey Proskuryakov
Comment 8 2017-01-19 17:36:01 PST
*** This bug has been marked as a duplicate of bug 22382 ***
Note You need to log in before you can comment on or make changes to this bug.