Monday, November 24, 2014

Re: sinking bitless events on a widget

Currently only 3 events are treated as bitless in GWT

I'm just stating the fact that if GWT changed all events to be bitless it would break some code due to the issue I stated.

Quote "This means I have to remember when using bitless events that the widget's element is set before I add a bitless dom handler. For standard events this is not the case"

On Monday, 24 November 2014 11:58:59 UTC, Thomas Broyer wrote:
IIRC, the eventBitsToAdd dance is there only to workaround memory leaks in old browsers, and is no longer needed most of the cases; and this is why sinkBitlessEvents doesn't do anything special: because it's designed for modern browsers that don't leak memory the way older ones did.
Better profile your app to be sure though.

On Monday, November 24, 2014 12:49:38 PM UTC+1, Paul wrote:
I'm doing some work adding IE10 pointer events to MGWT.

I have a slight issue which I can get round but thought to ask if the behaviour is correct.

On a widget if you call addDomHandler then DOM.sinkEvents(getElement(), eventBitsToAdd) is only called if the widget is attached to the DOM. If the widget is not attached to the DOM then the events you want to sink is simply stored (via an integer eventBitsToAdd). When you do attach the widget then DOM.sinkEvents will be called with the current value of eventBitsToAdd

For bitless events this is not the case.

On a widget if you call addBitlessDomHandler then DOM.sinkBitlessEvent(getElement(), eventTypeName) is called regardless whether the widget has been attached or not.

This means I have to remember when using bitless events that the widget's element is set before I add a bitless dom handler. For standard events this is not the case.

Do you think we should be storing up the bitless event type names when the widget is not attached and sink these bitless events when the widget is attached?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment