mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Update test case to feature-detect Opera's lack of defaultPrevented and skip the test for it.
This commit is contained in:
parent
b8931f7448
commit
007e2d152e
@ -314,7 +314,14 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
|
||||
e.preventDefault();
|
||||
});
|
||||
$main.delegate("#foo", "click", function(e) {
|
||||
var orig = e.originalEvent;
|
||||
if ( typeof(orig.defaultPrevented) === "boolean" || typeof(orig.returnValue) === "boolean" || orig.getPreventDefault ) {
|
||||
equals( e.isDefaultPrevented(), true, "isDefaultPrevented true passed to bubbled event" );
|
||||
}
|
||||
else {
|
||||
// Opera < 11 doesn't implement any interface we can use, so give it a pass
|
||||
ok( true, "isDefaultPrevented not supported by this browser, test skipped" );
|
||||
}
|
||||
});
|
||||
fakeClick( $anchor2 );
|
||||
$anchor2.unbind( "click" );
|
||||
|
Loading…
Reference in New Issue
Block a user