Make sure that mousing over Chrome "internal div" doesn't trigger a mouseleave. Fixes...
[jquery.git] / src / event.js
index a17cf89..a15603f 100644 (file)
@@ -652,15 +652,19 @@ var withinElement = function( event ) {
 
        // Firefox sometimes assigns relatedTarget a XUL element
        // which we cannot access the parentNode property of
-       // Chrome does something similar, the parentNode property
-       // can be accessed but is null.
        try {
+
+               // Chrome does something similar, the parentNode property
+               // can be accessed but is null.
+               if ( parent !== document && !parent.parentNode ) {
+                       return;
+               }
                // Traverse up the tree
                while ( parent && parent !== this ) {
                        parent = parent.parentNode;
                }
 
-               if ( parent && parent !== this ) {
+               if ( parent !== this ) {
                        // set the correct event type
                        event.type = event.data;