mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Ajax:Attributes:CSS:Manipulation: Reduce Android 2.3 support
Drop non-critical workarounds for Android 2.3. Fixes gh-2483 Fixes gh-2505 Closes gh-2581
This commit is contained in:
parent
64fd7ef3d0
commit
ce3b4a6242
@ -2,11 +2,7 @@ define( [
|
||||
"../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;
|
||||
|
||||
|
@ -18,11 +18,6 @@ define( [
|
||||
// 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" );
|
||||
|
@ -105,8 +105,7 @@ jQuery.extend( {
|
||||
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" ) ) ) {
|
||||
|
||||
|
10
src/css.js
10
src/css.js
@ -351,16 +351,6 @@ jQuery.each( [ "height", "width" ], function( i, name ) {
|
||||
};
|
||||
} );
|
||||
|
||||
// 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: "",
|
||||
|
@ -29,10 +29,7 @@ define( [
|
||||
// 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;" +
|
||||
@ -72,34 +69,6 @@ define( [
|
||||
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;
|
||||
}
|
||||
} );
|
||||
} )();
|
||||
|
@ -12,9 +12,8 @@ var wrapMap = {
|
||||
// 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>" ],
|
||||
|
@ -67,12 +67,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -85,12 +83,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -103,12 +99,10 @@ testIframeWithCallback(
|
||||
"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 ) ) {
|
||||
|
||||
@ -124,12 +118,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -142,12 +134,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -160,12 +150,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -178,12 +166,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -196,12 +182,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -214,12 +198,10 @@ testIframeWithCallback(
|
||||
"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 = {
|
||||
@ -232,30 +214,10 @@ testIframeWithCallback(
|
||||
"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
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user