]> source.dussan.org Git - jquery.git/commitdiff
Make sure that mousing over Chrome "internal div" doesn't trigger a mouseleave. Fixes...
authorAnton M <obhvsbypqghgc@gmail.com>
Tue, 8 Feb 2011 16:15:55 +0000 (17:15 +0100)
committerAnton M <obhvsbypqghgc@gmail.com>
Tue, 8 Feb 2011 16:15:55 +0000 (17:15 +0100)
Follow up to https://github.com/jquery/jquery/commit/4a828c93d40eb67b2041b08bbed0f1973442bd03
which was stupid and got reversed.

src/event.js

index f3a5d9f49a15ad4fc537d11bb85ed6fb6af12d83..a15603fc16e797571e8700579b98f59f61914742 100644 (file)
@@ -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;