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 b46dff3
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

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

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.