Fire middle/right-click events at content and remove click hack

Assigned to



17 years ago
11 days ago


(Reporter: john, Assigned: smaug)


(Depends on: 1 bug, Blocks: 3 bugs)

Dependency tree / graph
Bug Flags:
webcompat ?

Firefox Tracking Flags

(blocking2.0 -)


(Whiteboard: [webcompat], URL)



17 years ago
We are not supposed to fire the onclick event at content for middle click or
right click, but we still need the document to receive the event so that our
normal handlers can deal with it.  So we hack the event by setting the flag
NS_EVENT_FLAG_NO_CONTENT_DISPATCH, and not dispatching the event to content.

Input, however, still needs the middle click event for pasting, so it reverses
this flag temporarily.  It is very much a hack and makes things work badly. 
People who want to make a GUI based on our system (people like, for example,
*us*) need to be able to receive these events.

I propose instead that we fire a new kind of event normally, call it
moz_alt_click or something, when middle / right click is fired.  That way people
doing onclick won't get surprised, and our system can handle these events in a
normal manner instead of hacking around them.


17 years ago
Blocks: 151142

Comment 1

17 years ago
This may or may not block the event flow rewrite, but it probably affects it.
Blocks: 185758
Priority: -- → P3
Target Milestone: --- → Future
QA Contact: rakeshmishra → events


9 years ago
Duplicate of this bug: 485980


9 years ago
Duplicate of this bug: 503026


9 years ago
blocking2.0: --- → ?


9 years ago
Duplicate of this bug: 430310
Not blocking 1.9.3 on this. Olli, is this even a valid bug any more?
Assignee: john → Olli.Pettay
blocking2.0: ? → -


9 years ago
Blocks: 421112


8 years ago
Duplicate of this bug: 700549
It seems that IE9 doesn't support onclick attribute.

Google Chrome supports for left click and middle click.

Opera supports left click only, middle click always causes auto scroll, cannot prevent it.
I commented about "onclick" attribute.

Comment 9

6 years ago
This bug is really annoying as Chrome and Opera don't trigger the click events for other buttons than left mouse button on both document or dom elements.
Firefox doesn't do that either on dom elements, but for some reason it does on document.

So in my case I have an element in my document and run stopPropagation on click, a right click on this element will not hit the stop propagation and propagate all the way to the document handler where it will trigger an click event on that, which is a strange behavior IMO.
Blocks: 968240
No longer blocks: 110007

Comment 10

6 months ago
I believe since Firefox already shipped auxclick this document level click can be removed as other browsers don't fire click event anymore:

This is now causing subtle (albeit minor) compat issues even on YouTube's UI, as reported at

Flags: webcompat?
Whiteboard: [webcompat]
Component: Event Handling → User events and focus handling
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.