How to implement CSS3 GWT TransitionEnd receiver

I want to use the Mozilla CSS3 transitionend property to fire events when the CSS3 transition completes. I know that I can use timers for similar functionality, but in the spirit of CSS3 animation, release it to the browser. The following is an example of this event.

The rub: GWT 2.4 does not support this event in the DOM.setEventListener supported event types . I tried using:

DOM.sinkBitlessEvent(element, "transitionend"); 

But using the debugger, he found that it is only supported (by rewriting):

  • Dragenter
  • dragexit
  • Dragover
  • a drop

So, with the exception of writing a JSNI source event handler that opens me before a memory leak , how do I listen for an event on an element in GWT that is not supported by GWT out of the box?

For reference, it is shown below that GWT 2.3 builds to rearrange gecko_1.8 in DomImplStandard.java :

  protected native void sinkBitlessEventImpl(Element elem, String eventTypeName) /*-{ if (eventTypeName == "dragenter") elem.ondragenter = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent; if (eventTypeName == "dragexit") elem.ondragexit = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent; if (eventTypeName == "dragover") elem.ondragover = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent; if (eventTypeName == "drop") elem.ondrop = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent; }-*/ 
+4
source share
1 answer

This means that mgwt manages transition events (among others). They replace com.google.gwt.user.client.impl.DOMImpl with their own version. See module descriptor . But, looking at one of their DOMImpl (for example, DOMImplMobileSafari ), they write their own event handler:

 //transistion end if (chMask & 0x8000000) { if(bits & 0x8000000){ elem.addEventListener('webkitTransitionEnd', @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false); } } 

I do not understand how they manage memory leaks.

+1
source

Source: https://habr.com/ru/post/1386158/


All Articles