@@ -608,7 +608,7 @@ test("toggle(Function, Function, ...)", function() {
608608} ) ;
609609
610610test ( ".live()/.die()" , function ( ) {
611- expect ( 58 ) ;
611+ expect ( 61 ) ;
612612
613613 var submit = 0 , div = 0 , livea = 0 , liveb = 0 ;
614614
@@ -818,6 +818,43 @@ test(".live()/.die()", function() {
818818 jQuery ( 'span#liveSpan1 a' ) . click ( ) ;
819819
820820 jQuery ( 'span#liveSpan1' ) . die ( 'click' ) ;
821+
822+ // Work with deep selectors
823+ livee = 0 ;
824+
825+ function clickB ( ) { livee ++ ; }
826+
827+ jQuery ( "#nothiddendiv div" ) . live ( "click" , function ( ) { livee ++ ; } ) ;
828+ jQuery ( "#nothiddendiv div" ) . live ( "click" , clickB ) ;
829+ jQuery ( "#nothiddendiv div" ) . live ( "mouseover" , function ( ) { livee ++ ; } ) ;
830+
831+ equals ( livee , 0 , "No clicks, deep selector." ) ;
832+
833+ livee = 0 ;
834+ jQuery ( "#nothiddendivchild" ) . trigger ( "click" ) ;
835+ equals ( livee , 2 , "Click, deep selector." ) ;
836+
837+ livee = 0 ;
838+ jQuery ( "#nothiddendivchild" ) . trigger ( "mouseover" ) ;
839+ equals ( livee , 1 , "Mouseover, deep selector." ) ;
840+
841+ jQuery ( "#nothiddendiv div" ) . die ( "mouseover" ) ;
842+
843+ livee = 0 ;
844+ jQuery ( "#nothiddendivchild" ) . trigger ( "click" ) ;
845+ equals ( livee , 2 , "Click, deep selector." ) ;
846+
847+ livee = 0 ;
848+ jQuery ( "#nothiddendivchild" ) . trigger ( "mouseover" ) ;
849+ equals ( livee , 0 , "Mouseover, deep selector." ) ;
850+
851+ jQuery ( "#nothiddendiv div" ) . die ( "click" , clickB ) ;
852+
853+ livee = 0 ;
854+ jQuery ( "#nothiddendivchild" ) . trigger ( "click" ) ;
855+ equals ( livee , 1 , "Click, deep selector." ) ;
856+
857+ jQuery ( "#nothiddendiv div" ) . die ( "click" ) ;
821858} ) ;
822859
823860test ( "live with change" , function ( ) {
0 commit comments