Pages don't receive Mouse 4
Categories
(Core :: DOM: Events, enhancement)
Tracking
()
People
(Reporter: jrmuizel, Assigned: ltenenbaum)
References
(Blocks 3 open bugs)
Details
(Keywords: dev-doc-needed, webcompat:platform-bug)
User Story
user-impact-score:1300 platform-scheduled:2026-12-31
Attachments
(5 external files)
https://jrmuizel-tests.netlify.app/mouse-clicks.html will show Mouse 4 clicks in Chrome but not in Firefox
Chrome enabled this in 2018:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/MrKpBV26ik4/D_zmoAJrAQAJ
Updated•2 months ago
|
| Reporter | ||
Comment 1•2 months ago
|
||
Chrome navigates backwards if mouseup is not consumed.
Comment 2•2 months ago
|
||
Oh, we stopped doing that when we had web-compat issue of this. Yeah, for aligning to Chrome, we should fix this, but we need to do this in all platforms. Fortunately, we have "mousebutton.4th.enabled" pref and `"mousebutton.5th.enabled" pref, and all desktop platforms refer them.
And on Windows, some mouse utils may block the button message and send only the app command message. So, this could cause a new bug reports from some mouse users.
Updated•2 months ago
|
| Reporter | ||
Updated•2 months ago
|
Updated•1 month ago
|
Comment 3•1 month ago
|
||
Oh, sorry, I misremember that what the prefs doing.
The prefs were added to disable the buttons on Windows in bug 1052947. Therefore, their default are already "enabled".
On Windows and Linux, disabling the pref just stop handling the button event. I.e., it'll start does nothing. However, on macOS, these prefs are used differently. If they are enabled, back/forward commands are fired but otherwise, button events are fired instead.
I think those event handlers should always dispatch the button event first. However, the dispatchers cannot know whether the event is consumed by the web content if the target is a remote process. Therefore, EventStateManager::PostHandleEvent should handle their default as dispatching back/forward command event. However, there are two things for implementing these things.
Windows may send different command for 4th or 5th button event
If the button events are not consumed here, Windows will post a command event. We're handling it here. So, we should put the command to a new field of the button event... (Oh, we have not do that for the preceding WidgetKeyboardEvent! That's a regression of e10s!!)
Making a simple IPC may cause a security issue
The command event needs to be dispatched in the parent process since the handler is in the parent process. So, we need to notify the parent process of the default action command from EventStateManager::PostHandleEvent in the remote process. So, it seems that we need to make BrowserParent wait the reply from the remote process like shortcut key handling with eKeyPress.
Comment 4•1 month ago
|
||
eKeyDown and eKeyPress may be stored here to receiving a reply event. Then, the receiver verifies that it's sent by the parent process.
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Comment 5•1 month ago
|
||
| Assignee | ||
Comment 6•1 month ago
|
||
| Assignee | ||
Comment 7•1 month ago
|
||
| Assignee | ||
Comment 8•1 month ago
|
||
(I'll wait for review on the first two patches before requesting review on the GTK patch and adding Windows/macOS handling, just in case we decide to change the design.)
Updated•29 days ago
|
| Assignee | ||
Comment 9•29 days ago
|
||
| Assignee | ||
Comment 10•28 days ago
|
||
Comment 11•4 days ago
|
||
| Assignee | ||
Comment 12•4 days ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Changes which DOM events are fired; allows websites to use X1/X2 mouse buttons for specific purposes
[Affects Firefox for Android]: No
[Suggested wording]: mousedown, mouseup, and auxclick events are now fired for the X1/X2 mouse buttons with button set to 3/4 respectively. Calling preventDefault() on the mouseup or auxclick event prevents the default action of the button, which is usually to navigate backward/forward.
[Links (documentation, blog post, etc)]:
Comment 13•3 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d61d97da77ac
https://hg.mozilla.org/mozilla-central/rev/9e6f422d9e57
https://hg.mozilla.org/mozilla-central/rev/cedcd4688b9d
https://hg.mozilla.org/mozilla-central/rev/20bfa03ce3fa
https://hg.mozilla.org/mozilla-central/rev/7e63dc30cebf
Updated•11 hours ago
|
Description
•