Drop non-critical workarounds for Android 2.3.
Fixes gh-2483
Fixes gh-2505
Closes gh-2581
"../core"
], function( jQuery ) {
-// Support: Android 2.3
-// Workaround failure to string-cast null input
-jQuery.parseJSON = function( data ) {
- return JSON.parse( data + "" );
-};
+jQuery.parseJSON = JSON.parse;
return jQuery.parseJSON;
// Must access selectedIndex to make default options select
support.optSelected = opt.selected;
- // Support: Android<=2.3
- // Options inside disabled selects are incorrectly marked as disabled
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
// Support: IE<=11+
// An input loses its value after becoming a radio
input = document.createElement( "input" );
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
- ( support.optDisabled ?
- !option.disabled : option.getAttribute( "disabled" ) === null ) &&
+ !option.disabled &&
( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
};
} );
-// Support: Android 2.3
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
- function( elem, computed ) {
- if ( computed ) {
- return swap( elem, { "display": "inline-block" },
- curCSS, [ elem, "marginRight" ] );
- }
- }
-);
-
// These hooks are used by animate to expand properties
jQuery.each( {
margin: "",
// so they're executed at the same time to save the second computation.
function computeStyleTests() {
div.style.cssText =
-
- // Support: Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:border-box;box-sizing:border-box;" +
+ "box-sizing:border-box;" +
"display:block;position:absolute;" +
"margin:0;margin-top:1%;margin-right:50%;" +
"border:1px;padding:1px;" +
computeStyleTests();
}
return pixelMarginRightVal;
- },
- reliableMarginRight: function() {
-
- // Support: Android 2.3
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. (#3333)
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // This support function is only executed once so no memoizing is needed.
- var ret,
- marginDiv = div.appendChild( document.createElement( "div" ) );
-
- // Reset CSS: box-sizing; display; margin; border; padding
- marginDiv.style.cssText = div.style.cssText =
-
- // Support: Android 2.3
- // Vendor-prefix box-sizing
- "-webkit-box-sizing:content-box;box-sizing:content-box;" +
- "display:block;margin:0;border:0;padding:0";
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
- documentElement.appendChild( container );
-
- ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
-
- documentElement.removeChild( container );
- div.removeChild( marginDiv );
-
- return ret;
}
} );
} )();
// their parent elements (except for "table" element) could be omitted
// since browser parsers are smart enough to auto-insert them
- // Support: Android 2.3
- // Android browser doesn't auto-insert colgroup
- col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
+ // Auto-insert "colgroup" element
+ col: [ 2, "<table>", "</table>" ],
// Auto-insert "tbody" element
tr: [ 2, "<table>", "</table>" ],
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": true,
"noCloneChecked": false,
- "optDisabled": true,
"optSelected": false,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": false,
- "reliableMarginRight": true
+ "radioValue": false
};
} else if ( /msie 9\.0/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": true,
"noCloneChecked": false,
- "optDisabled": true,
"optSelected": false,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": false,
- "reliableMarginRight": true
+ "radioValue": false
};
} else if ( /chrome/i.test( userAgent ) ) {
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /8\.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": false,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /firefox/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /iphone os 8/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": false,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
+ "radioValue": true
};
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
expected = {
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
- "optDisabled": true,
"optSelected": true,
"pixelMarginRight": false,
"pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": true
- };
- } else if ( /android 2\.3/i.test( userAgent ) ) {
- expected = {
- "ajax": true,
- "boxSizingReliable": true,
- "checkClone": true,
- "checkOn": false,
- "clearCloneStyle": false,
- "cors": true,
- "createHTMLDocument": true,
- "focusin": false,
- "noCloneChecked": true,
- "optDisabled": false,
- "optSelected": true,
- "pixelMarginRight": true,
- "pixelPosition": false,
- "radioValue": true,
- "reliableMarginRight": false
+ "radioValue": true
};
}