gwt /
gwt /
53a4bf293c990ac6ce20bfd2c69f0b2dee963e51 The original behavior of DOM event sinks was that any element on which you
called sinkEvents() would have its events dispatched to the 'nearest listener',
as defined by DOM.setEventListener(). In practice this is always the Widget
that 'owns' that element. As Sandy points out, this is actually quite useful
behavior, because it allows you to sink specific events on sub-elements, but
not on the Widget's root element -- which means that onBrowserEvent() will be
called much less often in some instances.
I originally pulled this dispatch code out because I thought it was a leftover
that wasn't intended to be there in the first place. That was an overzealous
mistake on my part, and it turns out this behavior was actually specified in
the DOM.sinkEvents() method:
> Sets the current set of events sunk by a given element. These events will be
> fired to the nearest {@link EventListener} specified on any of the element's
> parents.
I also went ahead and added DOM.eventGetCurrentTarget(), which can useful when
the listener and the current target can be different.
Issue: 1159
Patch by: jgw
Review by: knorton
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1265 8db76d5a-ed1c-0410-87a9-c151d255dfc7
4 files changed