Closed Bug 2073171 Opened 2 months ago Closed 3 days ago

Pages don't receive Mouse 4

Categories

(Core :: DOM: Events, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
relnote-firefox --- 162+
firefox162 --- fixed

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)

Blocks: 2073172

Chrome navigates backwards if mouseup is not consumed.

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.

User Story: (updated)
Component: Widget: Win32 → DOM: Events
Summary: Pages don't receive Mouse 4 on Windows → Pages don't receive Mouse 4
Blocks: amzn-luna
User Story: (updated)
See Also: → 1720538

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.

Assignee: nobody → ltenenbaum
User Story: (updated)

(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.)

Attachment #9662136 - Attachment description: WIP: Bug 2073171 - Part 3: GTK handling of X1/X2 button presses. → Bug 2073171 - Part 3: GTK handling of X1/X2 button presses. r=masayuki!,#gtk-reviewers!
Blocks: 2083816
See Also: → 2085988

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)]:

relnote-firefox: --- → ?
Keywords: dev-doc-needed
Duplicate of this bug: 1720538
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: