Open Bug 1270654 Opened 9 years ago Updated 10 months ago

FF/Windows: Pressing middle button on element accidentally switches to scroll mode

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

45 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: brille1, Unassigned)

Details

(Whiteboard: btpp-backlog)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20160315153207 Steps to reproduce: Clicking the middle button on an arbitrary HTML element pretending to be a hyperlink by means of CSS "cursor: pointer;" property unintentionally switches FF to scroll mode. Actual results: Instead of following the user's intention of moving the mouse pointer out of the way after releasing the middle mouse button, the page is ludicrously being scrolled. Expected results: FF should stay scroll mode only while the middle mouse button is being pressed. As soon as the middle mouse button is being released, scroll mode should end immediately. I.e.: 1. User presses and holds down middle mouse button. 2. mousedown JavaScript event is sent to any listeners. 3. After all mousedown JavaScript events listeners have been handled, Scroll mode is entered. 4. As the users moves the mouse, the page is being scrolled. 5. User releases middle mouse button => Scroll mode is exited immediately. The suggested behaviour is rather similar to a drag/drop operation.
Component: Untriaged → Event Handling
Product: Firefox → Core
Whiteboard: btpp-backlog
Do you know if this is a regression? Do you have a reduced testcase? Thanks.
Flags: needinfo?(brille1)
I don't remember whether there actually ever was a different behaviour in Firefox. A reduced description would boil down to this: * Current behaviour: - middle button click event: Scroll mode on and off, resp. * Suggested behaviour: - middle button down event + initial mouse move event: Scroll mode on - middle button up event: Scroll mode off In pseudo TypeScript code I would suggest something like this: -------------------------------------------------------------- var scrollMode :boolean = false; -------------------------------------------------------------- function OnMouseMove(event :MouseEvent) { if (!scrollMode && (event.buttons & 4) === 4 // middle button pressed && (math.Abs(event.movementX) > 3 || math.Abs(event.movementY) > 3)) // min. movement threshold { scrollMode = true; } } -------------------------------------------------------------- function OnMouseUp(event :MouseEvent) { if (scrollMode && (event.buttons & 4) === 0) // middle button released { scrollMode = false; } }
Flags: needinfo?(brille1)
Component: Event Handling → User events and focus handling
Severity: normal → S3

I noticed that this issue has been re-raised in another issue, 10 years after this one: #1923233.

Can someone please deal with this issue and fix it?

You need to log in before you can comment on or make changes to this bug.