Mouse shortcuts don't work when dispatching a new MouseEvent
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: ryanjmack21, Unassigned)
Details
(Keywords: parity-chrome, parity-safari)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Steps to reproduce:
Not all clickable areas in our UI can be expressed as <a href> - we have complex dom elements with custom click handlers, such as table rows.
This is a contrived example of how we work around this limitation - https://jsfiddle.net/yb5me94t/ - It works as expected in Chrome v90 and Safari v14, but not Firefox v88.
Normal click works in FF in the linked JS Fiddle, but once you use any of the mouse shortcuts the event fails to do anything. I was able to reproduce in a production grade React app, on codepen.io and also on JSFiddle - the browser is definitely the issue.
Actual results:
Normal click works, any of the following mouse shortcuts do no work:
Shift + Left-click Open a link in a new window
Ctrl/Cmd + Left-click Open a link in a new tab in the background
Ctrl/Cmd + Shift + Left-click Open a link in a new tab and switch to the new tab
Expected results:
Mouse shortcuts should work when dispatching a new MouseEvent
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Reporter | ||
Comment 2•3 years ago
|
||
Another simple example - https://jsfiddle.net/L1hwxc4f/
Reporter | ||
Comment 3•3 years ago
|
||
Was able to reproduce the issue in FF v70 as well.
Comment 4•3 years ago
|
||
https://jsfiddle.net/d_toybox/kqgdpfcv/
Hmm, the event is initialized as expected. shiftKey
, ctrlKey
and metaKey
are derived from the trusted click
event. But perhaps, the modified link click is ignored by our content click event handler even if it's during the user's input.
Comment 5•3 years ago
|
||
And even if it's not during user input, the synthesized event is accepted.
https://jsfiddle.net/d_toybox/kqgdpfcv/1/
So, we could relax about the link click handling.
Comment 6•3 years ago
|
||
Okay, the cause must be here:
https://searchfox.org/mozilla-central/rev/6e630edb09c3ab06d0103665b16c9ea7dce782c5/dom/base/Element.cpp#3070-3071
So, this is now in the right component.
Comment 7•5 months ago
•
|
||
:masayuki, has this maybe been fixed? The testcase in comment #4 seems to work for me as it does in Chrome and Safari now.
Edit: yes, mozregression gives this regression range for the fix: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bf638341288eacbfd43ac6d8d3080e011ff1e8fb&tochange=853874dee29b2a068a74b2a550151afaffd939ce
This lead me to bug 1739929, fixed quite long ago now.
Updated•5 months ago
|
Description
•