https://bugzilla.wikimedia.org/show_bug.cgi?id=55448
Web browser: ---
Bug ID: 55448
Summary: VisualEditor: Clean up phantom mouse event code in
ve.ce.ProtectedNode
Product: VisualEditor
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: ContentEditable
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
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
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l