Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up for 22a4 #1199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/support.js
Expand Up @@ -13,7 +13,7 @@ jQuery.support = (function( support ) {
input.type = "checkbox";

// Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
support.checkOn = input.value === "";
support.checkOn = input.value !== "";

// Must access the parent to make an option select properly
// Support: IE9, IE10
Expand Down
143 changes: 143 additions & 0 deletions test/unit/support.js
Expand Up @@ -29,6 +29,149 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
strictEqual( shrinkWrapBlocks, jQuery.support.shrinkWrapBlocks, "jQuery.support.shrinkWrapBlocks properties are the same" );
});

(function() {
var expected,
userAgent = window.navigator.userAgent;

if ( /chrome/i.test( userAgent ) ) {
expected = {
"checkOn":true,
"optSelected":true,
"optDisabled":true,
"focusinBubbles":false,
"reliableMarginRight":true,
"noCloneChecked":true,
"radioValue":true,
"checkClone":true,
"boxModel":true,
"ajax":true,
"cors":true,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": true,
"boxSizing": true,
"boxSizingReliable": true,
"pixelPosition": false
};
} else if ( /opera.*version\/12\.1/i.test( userAgent ) ) {
expected = {
"checkOn":true,
"optSelected":true,
"optDisabled":true,
"focusinBubbles":false,
"reliableMarginRight":true,
"noCloneChecked":true,
"radioValue":false,
"checkClone":true,
"boxModel":true,
"ajax":true,
"cors":true,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": true,
"boxSizing": true,
"boxSizingReliable": true,
"pixelPosition": true
};
} else if ( /msie 10\.0/i.test( userAgent ) ) {
expected = {
"checkOn":true,
"optSelected":false,
"optDisabled":true,
"focusinBubbles":true,
"reliableMarginRight":true,
"noCloneChecked":false,
"radioValue":false,
"checkClone":true,
"boxModel":true,
"ajax":true,
"cors":true,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": false,
"boxSizing": true,
"boxSizingReliable": false,
"pixelPosition": true
};
} else if ( /msie 9\.0/i.test( userAgent ) ) {
expected = {
"checkOn":true,
"optSelected":false,
"optDisabled":true,
"focusinBubbles":true,
"reliableMarginRight":true,
"noCloneChecked":false,
"radioValue":false,
"checkClone":true,
"boxModel":true,
"ajax":true,
"cors":false,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": false,
"boxSizing": true,
"boxSizingReliable": false,
"pixelPosition": true
};
} else if ( /5\.1\.\d+ safari/i.test( userAgent ) ) {
expected = {
"checkOn":false,
"optSelected":true,
"optDisabled":true,
"focusinBubbles":false,
"reliableMarginRight":true,
"noCloneChecked":true,
"radioValue":true,
"checkClone":false,
"boxModel":true,
"ajax":true,
"cors":true,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": true,
"boxSizing": true,
"boxSizingReliable": true,
"pixelPosition": false
};
} else if ( /firefox/i.test( userAgent ) ) {
expected = {
"checkOn":true,
"optSelected":true,
"optDisabled":true,
"focusinBubbles":false,
"reliableMarginRight":true,
"noCloneChecked":true,
"radioValue":true,
"checkClone":true,
"boxModel":true,
"ajax":true,
"cors":true,
"doesNotIncludeMarginInBodyOffset":true,
"clearCloneStyle": true,
"boxSizing": true,
"boxSizingReliable": false,
"pixelPosition": true
};
}

if ( expected ) {
test("Verify that the support tests resolve as expected per browser", function() {
var i, prop,
j = 0;

for ( prop in jQuery.support ) {
j++;
}

expect( j );

for ( i in expected ) {
if ( jQuery.ajax || i !== "ajax" && i !== "cors" ) {
equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
} else {
ok( true, "no ajax; skipping jQuery.support['" + i + "']" );
}
}
});
}

})();

// Support: Safari 5.1
// Shameless browser-sniff, but Safari 5.1 mishandles CSP
if ( !( typeof navigator !== "undefined" &&
Expand Down