Commit 6a82f2ae authored by jeresig's avatar jeresig

Make sure that mousing over XUL elements results in no trigger of a mouseleave. Fixes #6013.

parent dd5c2630
...@@ -604,17 +604,12 @@ var withinElement = function( event ) { ...@@ -604,17 +604,12 @@ var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element // Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget; var parent = event.relatedTarget;
// Traverse up the tree
while ( parent && parent !== this ) {
// Firefox sometimes assigns relatedTarget a XUL element // Firefox sometimes assigns relatedTarget a XUL element
// which we cannot access the parentNode property of // which we cannot access the parentNode property of
try { try {
// Traverse up the tree
while ( parent && parent !== this ) {
parent = parent.parentNode; parent = parent.parentNode;
// assuming we've left the element since we most likely mousedover a xul element
} catch(e) {
break;
}
} }
if ( parent !== this ) { if ( parent !== this ) {
...@@ -625,6 +620,8 @@ var withinElement = function( event ) { ...@@ -625,6 +620,8 @@ var withinElement = function( event ) {
jQuery.event.handle.apply( this, arguments ); jQuery.event.handle.apply( this, arguments );
} }
// assuming we've left the element since we most likely mousedover a xul element
} catch(e) { }
}, },
// In case of event delegation, we only need to rename the event.type, // In case of event delegation, we only need to rename the event.type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment