2019-02-18 18:02:38 +00:00
|
|
|
QUnit.module( "support", { afterEach: moduleTeardown } );
|
2011-05-10 10:23:53 +00:00
|
|
|
|
2013-08-26 22:54:13 +00:00
|
|
|
var computedSupport = getComputedSupport( jQuery.support );
|
|
|
|
|
|
|
|
function getComputedSupport( support ) {
|
|
|
|
var prop,
|
|
|
|
result = {};
|
|
|
|
|
|
|
|
for ( prop in support ) {
|
|
|
|
if ( typeof support[ prop ] === "function" ) {
|
|
|
|
result[ prop ] = support[ prop ]();
|
|
|
|
} else {
|
|
|
|
result[ prop ] = support[ prop ];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2022-07-12 15:12:27 +00:00
|
|
|
if ( includesModule( "css" ) ) {
|
2016-04-10 19:42:44 +00:00
|
|
|
testIframe(
|
2022-01-12 22:23:10 +00:00
|
|
|
"body background is not lost if set prior to loading jQuery (trac-9239)",
|
2015-08-16 03:45:28 +00:00
|
|
|
"support/bodyBackground.html",
|
2016-04-10 19:42:44 +00:00
|
|
|
function( assert, jQuery, window, document, color, support ) {
|
2015-08-16 03:45:28 +00:00
|
|
|
assert.expect( 2 );
|
|
|
|
var okValue = {
|
|
|
|
"#000000": true,
|
|
|
|
"rgb(0, 0, 0)": true
|
|
|
|
};
|
|
|
|
assert.ok( okValue[ color ], "color was not reset (" + color + ")" );
|
2011-10-31 22:24:34 +00:00
|
|
|
|
2016-01-27 11:13:32 +00:00
|
|
|
assert.deepEqual( jQuery.extend( {}, support ), computedSupport,
|
|
|
|
"Same support properties" );
|
2015-08-16 03:45:28 +00:00
|
|
|
}
|
|
|
|
);
|
2012-06-11 01:54:16 +00:00
|
|
|
}
|
2011-08-04 22:56:49 +00:00
|
|
|
|
2014-12-15 00:48:53 +00:00
|
|
|
// This test checks CSP only for browsers with "Content-Security-Policy" header support
|
2013-10-30 12:20:38 +00:00
|
|
|
// i.e. no old WebKit or old Firefox
|
2016-04-10 19:42:44 +00:00
|
|
|
testIframe(
|
2015-08-16 03:45:28 +00:00
|
|
|
"Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions",
|
2017-08-01 16:52:45 +00:00
|
|
|
"mock.php?action=cspFrame",
|
2016-04-10 19:42:44 +00:00
|
|
|
function( assert, jQuery, window, document, support ) {
|
2015-09-08 00:26:29 +00:00
|
|
|
var done = assert.async();
|
|
|
|
|
2015-08-16 03:45:28 +00:00
|
|
|
assert.expect( 2 );
|
2016-01-27 11:13:32 +00:00
|
|
|
assert.deepEqual( jQuery.extend( {}, support ), computedSupport,
|
|
|
|
"No violations of CSP polices" );
|
2013-10-30 12:20:38 +00:00
|
|
|
|
2017-08-01 16:52:45 +00:00
|
|
|
supportjQuery.get( baseURL + "support/csp.log" ).done( function( data ) {
|
2015-08-16 03:45:28 +00:00
|
|
|
assert.equal( data, "", "No log request should be sent" );
|
2017-08-01 16:52:45 +00:00
|
|
|
supportjQuery.get( baseURL + "mock.php?action=cspClean" ).done( done );
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2013-10-30 12:20:38 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2023-07-10 16:26:45 +00:00
|
|
|
testIframe(
|
|
|
|
"Verify correctness of support tests with bootstrap CSS on the page",
|
|
|
|
"support/bootstrap.html",
|
|
|
|
function( assert, jQuery, window, document, bodyStyle, support ) {
|
|
|
|
assert.expect( 2 );
|
|
|
|
assert.strictEqual( bodyStyle.boxSizing, "border-box",
|
|
|
|
"border-box applied on body by Bootstrap" );
|
|
|
|
assert.deepEqual( jQuery.extend( {}, support ), computedSupport,
|
|
|
|
"Same support properties" );
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
( function() {
|
2020-01-27 17:54:47 +00:00
|
|
|
var browserKey, expected,
|
2018-04-23 12:16:21 +00:00
|
|
|
userAgent = window.navigator.userAgent,
|
|
|
|
expectedMap = {
|
|
|
|
edge: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: false,
|
|
|
|
scope: false,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
ie_9: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: false,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
|
|
|
cors: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
createHTMLDocument: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
disconnectedMatch: false,
|
|
|
|
getById: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
noCloneChecked: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
option: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
optSelected: false,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: false,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: false,
|
|
|
|
scope: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
scrollboxSize: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
ie_10_11: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: false,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
|
|
|
cors: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
createHTMLDocument: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
noCloneChecked: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
option: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
optSelected: false,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: false,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: false,
|
|
|
|
scope: false,
|
2023-02-14 10:42:29 +00:00
|
|
|
scrollboxSize: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
chrome_111: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
chrome: {
|
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
|
|
|
cssHas: true,
|
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
|
|
|
},
|
|
|
|
safari_16_3: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
safari: {
|
2023-01-23 22:49:44 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2023-01-23 22:49:44 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
firefox_60: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
2023-04-04 22:44:01 +00:00
|
|
|
reliableMarginLeft: false,
|
|
|
|
reliableTrDimensions: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
firefox: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: false,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
ios_7: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
pixelBoxStyles: false,
|
|
|
|
pixelPosition: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
radioValue: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
reliableMarginLeft: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-07-09 16:37:52 +00:00
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
ios_8: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
createHTMLDocument: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
pixelBoxStyles: false,
|
|
|
|
pixelPosition: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
|
|
|
ios_9_10: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: false,
|
|
|
|
pixelPosition: false,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-02-14 10:42:29 +00:00
|
|
|
ios_11_15_3: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
createHTMLDocument: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
ios_15_4_16_3: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: false,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
2018-04-23 12:16:21 +00:00
|
|
|
},
|
2023-04-04 22:44:01 +00:00
|
|
|
ios: {
|
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: true,
|
|
|
|
checkOn: true,
|
|
|
|
clearCloneStyle: true,
|
|
|
|
cssHas: true,
|
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: true,
|
|
|
|
pixelPosition: true,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: true,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: true,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: true,
|
|
|
|
sortStable: true
|
|
|
|
},
|
2018-04-23 12:16:21 +00:00
|
|
|
android: {
|
2022-12-14 00:41:31 +00:00
|
|
|
ajax: true,
|
|
|
|
boxSizingReliable: true,
|
|
|
|
checkClone: false,
|
|
|
|
checkOn: false,
|
|
|
|
clearCloneStyle: true,
|
2023-02-14 10:42:29 +00:00
|
|
|
cssHas: true,
|
2022-12-14 00:41:31 +00:00
|
|
|
cors: true,
|
|
|
|
createHTMLDocument: true,
|
|
|
|
disconnectedMatch: true,
|
|
|
|
getById: true,
|
|
|
|
noCloneChecked: true,
|
|
|
|
option: true,
|
|
|
|
optSelected: true,
|
|
|
|
pixelBoxStyles: false,
|
|
|
|
pixelPosition: false,
|
|
|
|
radioValue: true,
|
|
|
|
reliableMarginLeft: false,
|
|
|
|
reliableTrDimensions: true,
|
|
|
|
scope: false,
|
|
|
|
scrollboxSize: true,
|
|
|
|
sortDetached: false,
|
|
|
|
sortStable: false
|
2018-04-23 12:16:21 +00:00
|
|
|
}
|
|
|
|
};
|
2013-03-07 14:15:12 +00:00
|
|
|
|
2020-01-27 17:54:47 +00:00
|
|
|
// Make the slim build pass tests.
|
|
|
|
for ( browserKey in expectedMap ) {
|
2022-12-14 00:41:31 +00:00
|
|
|
if ( !includesModule( "ajax" ) ) {
|
2020-01-27 17:54:47 +00:00
|
|
|
delete expectedMap[ browserKey ].ajax;
|
|
|
|
delete expectedMap[ browserKey ].cors;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-14 00:41:31 +00:00
|
|
|
// Make the selector-native build pass tests.
|
|
|
|
for ( browserKey in expectedMap ) {
|
|
|
|
if ( !includesModule( "selector" ) ) {
|
2023-02-14 10:42:29 +00:00
|
|
|
delete expectedMap[ browserKey ].cssHas;
|
2022-12-14 00:41:31 +00:00
|
|
|
delete expectedMap[ browserKey ].disconnectedMatch;
|
|
|
|
delete expectedMap[ browserKey ].getById;
|
|
|
|
delete expectedMap[ browserKey ].scope;
|
|
|
|
delete expectedMap[ browserKey ].sortDetached;
|
|
|
|
delete expectedMap[ browserKey ].sortStable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-04 22:44:01 +00:00
|
|
|
if ( /\bedge\//i.test( userAgent ) ) {
|
2018-04-23 12:16:21 +00:00
|
|
|
expected = expectedMap.edge;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\bmsie 9\.0/i.test( userAgent ) ) {
|
2018-04-23 12:16:21 +00:00
|
|
|
expected = expectedMap.ie_9;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\b(?:msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
|
2023-02-14 10:42:29 +00:00
|
|
|
expected = expectedMap.ie_10_11;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\b(?:headless)?chrome\/(?:10\d|11[01])\b/i.test( userAgent ) ) {
|
|
|
|
expected = expectedMap.chrome_111;
|
|
|
|
} else if ( /\b(?:headless)?chrome\//i.test( userAgent ) ) {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2015-06-13 22:50:05 +00:00
|
|
|
// Catches Chrome on Android as well (i.e. the default
|
|
|
|
// Android browser on Android >= 4.4).
|
2018-04-23 12:16:21 +00:00
|
|
|
expected = expectedMap.chrome;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\bfirefox\/[456]\d\b/i.test( userAgent ) ) {
|
2018-07-09 16:37:52 +00:00
|
|
|
expected = expectedMap.firefox_60;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\bfirefox\//i.test( userAgent ) ) {
|
2018-04-23 12:16:21 +00:00
|
|
|
expected = expectedMap.firefox;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\bandroid 4\.[0-3]/i.test( userAgent ) ) {
|
2019-09-23 18:00:24 +00:00
|
|
|
expected = expectedMap.android;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\biphone os 7_/i.test( userAgent ) ) {
|
2018-04-23 12:16:21 +00:00
|
|
|
expected = expectedMap.ios_7;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\biphone os 8_/i.test( userAgent ) ) {
|
2023-02-14 10:42:29 +00:00
|
|
|
expected = expectedMap.ios_8;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\biphone os (?:9|10)_/i.test( userAgent ) ) {
|
2023-02-14 10:42:29 +00:00
|
|
|
expected = expectedMap.ios_9_10;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\biphone os (?:1[1234]_|15_[0123])/i.test( userAgent ) ) {
|
2023-02-14 10:42:29 +00:00
|
|
|
expected = expectedMap.ios_11_15_3;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\biphone os (?:15_|16_[0123])/i.test( userAgent ) ) {
|
|
|
|
expected = expectedMap.ios_15_4_16_3;
|
|
|
|
} else if ( /\b(?:iphone|ipad);.*(?:iphone)? os \d+_/i.test( userAgent ) ) {
|
2019-09-23 17:28:43 +00:00
|
|
|
expected = expectedMap.ios;
|
2023-04-04 22:44:01 +00:00
|
|
|
} else if ( /\bversion\/(?:15|16\.[0123])(?:\.\d+)* safari/i.test( userAgent ) ) {
|
|
|
|
expected = expectedMap.safari_16_3;
|
|
|
|
} else if ( /\bversion\/\d+(?:\.\d+)+ safari/i.test( userAgent ) ) {
|
2019-09-23 18:00:24 +00:00
|
|
|
expected = expectedMap.safari;
|
2013-03-07 14:15:12 +00:00
|
|
|
}
|
|
|
|
|
2015-05-08 03:16:18 +00:00
|
|
|
QUnit.test( "Verify that support tests resolve as expected per browser", function( assert ) {
|
|
|
|
if ( !expected ) {
|
|
|
|
assert.expect( 1 );
|
|
|
|
assert.ok( false, "Known client: " + userAgent );
|
|
|
|
}
|
2013-03-07 14:15:12 +00:00
|
|
|
|
2015-05-08 03:16:18 +00:00
|
|
|
var i, prop,
|
|
|
|
j = 0;
|
2013-03-07 14:15:12 +00:00
|
|
|
|
2015-05-08 03:16:18 +00:00
|
|
|
for ( prop in computedSupport ) {
|
|
|
|
j++;
|
|
|
|
}
|
2013-03-07 14:15:12 +00:00
|
|
|
|
2022-12-14 00:41:31 +00:00
|
|
|
// Add an assertion per undefined support prop as it may
|
|
|
|
// not even exist on computedSupport but we still want to run
|
|
|
|
// the check.
|
|
|
|
for ( prop in expected ) {
|
|
|
|
if ( expected[ prop ] === undefined ) {
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-08 03:16:18 +00:00
|
|
|
assert.expect( j );
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2015-05-08 03:16:18 +00:00
|
|
|
for ( i in expected ) {
|
2022-07-12 15:12:27 +00:00
|
|
|
if ( includesModule( "ajax" ) || i !== "ajax" && i !== "cors" ) {
|
2015-05-08 03:16:18 +00:00
|
|
|
assert.equal( computedSupport[ i ], expected[ i ],
|
|
|
|
"jQuery.support['" + i + "']: " + computedSupport[ i ] +
|
2023-01-23 22:49:44 +00:00
|
|
|
", expected['" + i + "']: " + expected[ i ] +
|
|
|
|
";\nUser Agent: " + navigator.userAgent );
|
2015-05-08 03:16:18 +00:00
|
|
|
} else {
|
|
|
|
assert.ok( true, "no ajax; skipping jQuery.support['" + i + "']" );
|
2013-03-07 14:15:12 +00:00
|
|
|
}
|
2015-05-08 03:16:18 +00:00
|
|
|
}
|
2016-01-27 11:13:32 +00:00
|
|
|
} );
|
2013-03-07 14:15:12 +00:00
|
|
|
|
2018-04-23 12:16:21 +00:00
|
|
|
QUnit.test( "Verify most support tests are failing in one " +
|
|
|
|
"of tested browsers", function( assert ) {
|
|
|
|
|
|
|
|
var prop, browserKey, supportTestName,
|
|
|
|
i = 0,
|
|
|
|
supportProps = {},
|
|
|
|
failingSupportProps = {},
|
|
|
|
whitelist = {
|
|
|
|
ajax: true
|
|
|
|
};
|
|
|
|
|
|
|
|
for ( prop in computedSupport ) {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
2022-12-14 00:41:31 +00:00
|
|
|
// Add an assertion per undefined support prop as it may
|
|
|
|
// not even exist on computedSupport but we still want to run
|
|
|
|
// the check.
|
|
|
|
for ( prop in expected ) {
|
|
|
|
if ( expected[ prop ] === undefined ) {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 12:16:21 +00:00
|
|
|
assert.expect( i );
|
|
|
|
|
|
|
|
// Record all support props and the failing ones and ensure everyone
|
|
|
|
// except a few on a whitelist are failing at least once.
|
|
|
|
for ( browserKey in expectedMap ) {
|
|
|
|
for ( supportTestName in expectedMap[ browserKey ] ) {
|
|
|
|
supportProps[ supportTestName ] = true;
|
2022-12-14 00:41:31 +00:00
|
|
|
if ( !expectedMap[ browserKey ][ supportTestName ] ) {
|
2018-04-23 12:16:21 +00:00
|
|
|
failingSupportProps[ supportTestName ] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( supportTestName in supportProps ) {
|
|
|
|
assert.ok( whitelist[ supportTestName ] || failingSupportProps[ supportTestName ],
|
|
|
|
"jQuery.support['" + supportTestName + "'] always succeeds; remove it?" );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
} )();
|