Bug 166849
Summary: | Consider implementing auxclick event | ||
---|---|---|---|
Product: | WebKit | Reporter: | Navid <nzolghadr> |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | cdumez, darin, dave+webkit, rniwa |
Priority: | P2 | ||
Version: | Other | ||
Hardware: | All | ||
OS: | All |
Navid
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Tapuska
@cdumez: Chris do you have any position on this request?
Chris Dumez
Seems reasonable to me, especially if Firefox / Chrome already shipped this.
Chris Dumez
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
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
(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
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
@Chris, did what I say address your concern? Does the proposal/spec look reasonable?
Alexey Proskuryakov
*** This bug has been marked as a duplicate of bug 22382 ***