Skip to content

Commit

Permalink
Merge branch 'fix-8456-lost-mouseenter' of https://github.com/dmethvi…
Browse files Browse the repository at this point in the history
…n/jquery into dmethvin-fix-8456-lost-mouseenter
  • Loading branch information
jeresig committed Mar 21, 2011
2 parents 5c79f82 + 2ac4067 commit 7705c35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/event.js
Expand Up @@ -661,7 +661,7 @@ var withinElement = function( event ) {

// Chrome does something similar, the parentNode property
// can be accessed but is null.
if ( parent !== document && !parent.parentNode ) {
if ( parent && parent !== document && !parent.parentNode ) {
return;
}
// Traverse up the tree
Expand Down
14 changes: 14 additions & 0 deletions test/unit/event.js
Expand Up @@ -683,6 +683,20 @@ test("hover()", function() {
equals( times, 4, "hover handlers fired" );
});

test("mouseover triggers mouseenter", function() {
expect(1);

var count = 0,
elem = jQuery("<a />");
elem.mouseenter(function () {
count++;
});
elem.trigger('mouseover');
equals(count, 1, "make sure mouseover triggers a mouseenter" );

elem.remove();
});

test("trigger() shortcuts", function() {
expect(6);

Expand Down

0 comments on commit 7705c35

Please sign in to comment.