File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ var withinElement = function( event ) {
661
661
662
662
// Chrome does something similar, the parentNode property
663
663
// can be accessed but is null.
664
- if ( parent !== document && ! parent . parentNode ) {
664
+ if ( parent && parent !== document && ! parent . parentNode ) {
665
665
return ;
666
666
}
667
667
// Traverse up the tree
Original file line number Diff line number Diff line change @@ -683,6 +683,20 @@ test("hover()", function() {
683
683
equals ( times , 4 , "hover handlers fired" ) ;
684
684
} ) ;
685
685
686
+ test ( "mouseover triggers mouseenter" , function ( ) {
687
+ expect ( 1 ) ;
688
+
689
+ var count = 0 ,
690
+ elem = jQuery ( "<a />" ) ;
691
+ elem . mouseenter ( function ( ) {
692
+ count ++ ;
693
+ } ) ;
694
+ elem . trigger ( 'mouseover' ) ;
695
+ equals ( count , 1 , "make sure mouseover triggers a mouseenter" ) ;
696
+
697
+ elem . remove ( ) ;
698
+ } ) ;
699
+
686
700
test ( "trigger() shortcuts" , function ( ) {
687
701
expect ( 6 ) ;
688
702
You can’t perform that action at this time.
0 commit comments