Currently, the mouse event handling in phantoms is:
// mouseenter on the protectednode ve.ce.ProtectedNode.prototype.onProtectedMouseEnter = function () { if ( !this.root.getSurface().dragging ) { this.createPhantoms(); } }; // mousemove on the surface, bound by createPhantoms and unbound by clearPhantoms ve.ce.ProtectedNode.prototype.onSurfaceMouseMove = function ( e ) { var $target = $( e.target ); if ( !$target.hasClass( 've-ce-protectedNode-phantom' ) && $target.closest( '.ve-ce-protectedNode' ).length === 0 ) { this.clearPhantoms(); } }; // mouseout on the surface, bound by createPhantoms and unbound by clearPhantoms ve.ce.ProtectedNode.prototype.onSurfaceMouseOut = function ( e ) { if ( e.toElement === null ) { this.clearPhantoms(); } };
Issues:
- the mousemove handler seems to permit moving the mouse directly to a different ProtectedNode without causing the phantoms to be cleared
- the mouseout handler uses e.toElement, which is a poorly documented property that's allegedly IE-only
- it's generally very difficult to reason about what this code does or convince oneself that it does something reasonable
Version: unspecified
Severity: normal