com.google.gwt.user.client.Element target = eventTarget.cast();
// Get the event listener, which is the first widget that handles the
// specified event type.
String typeName = event.getType();
EventListener listener = DOM.getEventListener(target);
while (target != null && listener == null) {
target = target.getParentElement().cast();
if (target != null && isNonBubblingEventHandled(target, typeName)) {
// The target handles the event, so this must be the event listener.
listener = DOM.getEventListener(target);