Open Bug 329119 Opened 19 years ago Updated 2 years ago

Fix the handling of NS_EVENT_FLAG_NO_CONTENT_DISPATCH

Categories

(Core :: DOM: Events, defect, P3)

x86
All
defect

Tracking

()

People

(Reporter: smaug, Unassigned)

References

Details

NS_EVENT_FLAG_NO_CONTENT_DISPATCH flag is not checked in nsDocument::HandleDOMEvent nor in nsXULElement::HandleDOMEvent.
If that is added to nsDocument, middle mouse pasting stops working in Editor.
Not sure what breaks if it is added to nsXULElement.
Changing summary now that bug 234455 has landed.
We should try to remove mForceContentDispatch
http://lxr.mozilla.org/seamonkey/source/content/events/public/nsEventDispatcher.h#163
Or at least decide when and how NS_EVENT_FLAG_NO_CONTENT_DISPATCH should work.
Summary: NS_EVENT_FLAG_NO_CONTENT_DISPATCH flag is not checked in nsDocument::HandleDOMEvent nor in nsXULElement::HandleDOMEvent → Fix the handling of NS_EVENT_FLAG_NO_CONTENT_DISPATCH
Depends on: 329810
Is the problem that editor wants middle mouse click events but content doesn't?
So as I understand it, middle-click events are wanted by chrome (at least in some cases, possibly in all?) and editor and "not wanted" by content (as in web page onclick handlers don't check which button was clicked, typically).

Which brings me to two questions:

1)  Are the chrome handlers running in the system event group?  The ones that
    listen to events in HTML documents should be, but I guess others may not be.
2)  What about the editor handlers?

As in, perhaps we should just dispatch middle-click to the system event group?  Or would that break chrome stuff in some cases?
(In reply to comment #3)
>So as I understand it, middle-click events are wanted by chrome (at least in
>some cases, possibly in all?) and editor and "not wanted" by content (as in
> web page onclick handlers don't check which button was clicked, typically).
>
>Which brings me to two questions:
>
>1) Are the chrome handlers running in the system event group?  The ones that
>   listen to events in HTML documents should be, but I guess others may not be.
If you mean the click handlers in chrome XUL, then no, they just use onclick.
> If you mean the click handlers in chrome XUL, then no, they just use onclick.

And they check for middle click?

I guess the question is this.  What dispatch is prevented by NS_EVENT_FLAG_NO_CONTENT_DISPATCH right now?  What dispatch _should_ be prevented?  Why do differences between the two arise?

Then we fix the things that come up in answer to the last question.  ;)

It sounds to me like the answer to the second question is:

  Dispatch to event handlers in the normal event group attached to nodes that
  are not in chrome.

or something like that?
Assignee: events → nobody
QA Contact: ian → events
I don't understand this well, but...

(In reply to Boris Zbarsky (:bz) from comment #5)
> I guess the question is this.  What dispatch is prevented by
> NS_EVENT_FLAG_NO_CONTENT_DISPATCH right now?

non-left button's click events are prevented.

> It sounds to me like the answer to the second question is:
> 
>   Dispatch to event handlers in the normal event group attached to nodes that
>   are not in chrome.

I guess that this is right approach.
See Also: → 1379466
Priority: -- → P3

I have patches to rip out all the noContentDispatch stuff on top of bug 1379466, and they seem to be green

This involves a behaviour change in that chrome HTML will always get non-primary clicks now (as opposed to just Input/TextArea and window & document), but we probably want that for browser.xhtml anyway.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.