Firing events at the window vs. firing them at the chrome event handler

2013-03-03 Thread Zack Weinberg
If an event is dispatched from C++ using 
nsContentUtils::DispatchTrustedEvent with both the 'bubbles' and 
'cancelable' flags set false, what precisely is the difference between 
targeting it at a document's window and targeting it at the document's 
window's chrome event handler?  In particular, if such an event is 
targeted at the window, is there any circumstance in which a handler 
registered from chrome JS on gBrowser will *not* get a crack at it?


zw
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Firing events at the window vs. firing them at the chrome event handler

2013-03-03 Thread Boris Zbarsky

On 3/3/13 10:12 PM, Zack Weinberg wrote:

If an event is dispatched from C++ using
nsContentUtils::DispatchTrustedEvent with both the 'bubbles' and
'cancelable' flags set false, what precisely is the difference between
targeting it at a document's window and targeting it at the document's
window's chrome event handler?


The main difference is whether the web page will be able to see the 
events, I think.



In particular, if such an event is
targeted at the window, is there any circumstance in which a handler
registered from chrome JS on gBrowser will *not* get a crack at it?


If it's a capturing handler, it should work, assuming nothing else 
higher up in chrome captures and eats them...


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform