Skip to content
Permalink
Browse files
Make sure that mousing over Chrome "internal div" doesn't trigger a m…
…ouseleave. Fixes #8209.

Follow up to 4a828c9
which was stupid and got reversed.
  • Loading branch information
jitter committed Feb 8, 2011
1 parent 944e0e6 commit b46dff39c35ae05f92f6909ff8d07aa470e4a8d4
Showing 1 changed file with 6 additions and 0 deletions.
@@ -653,6 +653,12 @@ var withinElement = function( event ) {
// Firefox sometimes assigns relatedTarget a XUL element
// which we cannot access the parentNode property of
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;

2 comments on commit b46dff3

@jfirebaugh
Copy link

@jfirebaugh jfirebaugh commented on b46dff3 Mar 7, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a mouseenter event to get lost if parent is null. The condition should be parent && parent !== document && !parent.parentNode.

@jfirebaugh
Copy link

@jfirebaugh jfirebaugh commented on b46dff3 Mar 7, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.