On 2013-03-03 10:25 PM, Boris Zbarsky wrote:
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.

That's also what I thought, but it's good to have confirmation.

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

So I guess the next question is where does one put a capturing event handler so that it will see *all* events of the relevant type regardless of which window it was dispatched to or the contents of that window, and the immediate followup is whether it's possible for that handler to retrieve the window (originalTarget?) and learn its chrome structure (e.g. 'is this document in a tab, and if so, which tab?')

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

Reply via email to