mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Event: Don't test stopImmediatePropagation in Android 2.3
Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation in such a case.
This commit is contained in:
parent
b5074944b0
commit
14e0a632a0
@ -387,7 +387,13 @@ test("on immediate propagation", function() {
|
||||
});
|
||||
|
||||
test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
|
||||
// Support: Android 2.3
|
||||
if ( /android 2\.3/i.test( navigator.userAgent ) ) {
|
||||
expect( 2 );
|
||||
} else {
|
||||
expect( 3 );
|
||||
}
|
||||
|
||||
var $anchor2 = jQuery( "#anchor2" ),
|
||||
$main = jQuery( "#qunit-fixture" ),
|
||||
neverCallMe = function() {
|
||||
@ -418,6 +424,10 @@ test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
|
||||
$anchor2.off( "click" );
|
||||
$main.off( "click", "**" );
|
||||
|
||||
// Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation
|
||||
// in such a case.
|
||||
// Support: Android 2.3
|
||||
if ( !/android 2\.3/i.test( navigator.userAgent ) ) {
|
||||
$anchor2.on( "click", function( e ) {
|
||||
e.stopImmediatePropagation();
|
||||
ok( true, "anchor was clicked and prop stopped" );
|
||||
@ -425,6 +435,7 @@ test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
|
||||
$anchor2[0].addEventListener( "click", neverCallMe, false );
|
||||
fakeClick( $anchor2 );
|
||||
$anchor2[0].removeEventListener( "click", neverCallMe );
|
||||
}
|
||||
});
|
||||
|
||||
test("on(), iframes", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user