Commit 2ac4067a authored by Dave Methvin's avatar Dave Methvin

Fixes #8456. Make sure parent is not null before crawling into its lap, so...

Fixes #8456. Make sure parent is not null before crawling into its lap, so mouseenter is triggered on a mouseover event.
parent 6c124d3d
...@@ -661,7 +661,7 @@ var withinElement = function( event ) { ...@@ -661,7 +661,7 @@ var withinElement = function( event ) {
// Chrome does something similar, the parentNode property // Chrome does something similar, the parentNode property
// can be accessed but is null. // can be accessed but is null.
if ( parent !== document && !parent.parentNode ) { if ( parent && parent !== document && !parent.parentNode ) {
return; return;
} }
// Traverse up the tree // Traverse up the tree
......
...@@ -683,6 +683,20 @@ test("hover()", function() { ...@@ -683,6 +683,20 @@ test("hover()", function() {
equals( times, 4, "hover handlers fired" ); 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() { test("trigger() shortcuts", function() {
expect(6); expect(6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment