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"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
|
|
||||||
// Support: Android 2.3
|
jQuery.parseJSON = JSON.parse;
|
||||||
// Workaround failure to string-cast null input
|
|
||||||
jQuery.parseJSON = function( data ) {
|
|
||||||
return JSON.parse( data + "" );
|
|
||||||
};
|
|
||||||
|
|
||||||
return jQuery.parseJSON;
|
return jQuery.parseJSON;
|
||||||
|
|
||||||
|
@ -18,11 +18,6 @@ define( [
|
|||||||
// Must access selectedIndex to make default options select
|
// Must access selectedIndex to make default options select
|
||||||
support.optSelected = opt.selected;
|
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+
|
// Support: IE<=11+
|
||||||
// An input loses its value after becoming a radio
|
// An input loses its value after becoming a radio
|
||||||
input = document.createElement( "input" );
|
input = document.createElement( "input" );
|
||||||
|
@ -105,8 +105,7 @@ jQuery.extend( {
|
|||||||
if ( ( option.selected || i === index ) &&
|
if ( ( option.selected || i === index ) &&
|
||||||
|
|
||||||
// Don't return options that are disabled or in a disabled optgroup
|
// Don't return options that are disabled or in a disabled optgroup
|
||||||
( support.optDisabled ?
|
!option.disabled &&
|
||||||
!option.disabled : option.getAttribute( "disabled" ) === null ) &&
|
|
||||||
( !option.parentNode.disabled ||
|
( !option.parentNode.disabled ||
|
||||||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
|
!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
|
// These hooks are used by animate to expand properties
|
||||||
jQuery.each( {
|
jQuery.each( {
|
||||||
margin: "",
|
margin: "",
|
||||||
|
@ -29,10 +29,7 @@ define( [
|
|||||||
// so they're executed at the same time to save the second computation.
|
// so they're executed at the same time to save the second computation.
|
||||||
function computeStyleTests() {
|
function computeStyleTests() {
|
||||||
div.style.cssText =
|
div.style.cssText =
|
||||||
|
"box-sizing:border-box;" +
|
||||||
// Support: Android 2.3
|
|
||||||
// Vendor-prefix box-sizing
|
|
||||||
"-webkit-box-sizing:border-box;box-sizing:border-box;" +
|
|
||||||
"display:block;position:absolute;" +
|
"display:block;position:absolute;" +
|
||||||
"margin:0;margin-top:1%;margin-right:50%;" +
|
"margin:0;margin-top:1%;margin-right:50%;" +
|
||||||
"border:1px;padding:1px;" +
|
"border:1px;padding:1px;" +
|
||||||
@ -72,34 +69,6 @@ define( [
|
|||||||
computeStyleTests();
|
computeStyleTests();
|
||||||
}
|
}
|
||||||
return pixelMarginRightVal;
|
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
|
// their parent elements (except for "table" element) could be omitted
|
||||||
// since browser parsers are smart enough to auto-insert them
|
// since browser parsers are smart enough to auto-insert them
|
||||||
|
|
||||||
// Support: Android 2.3
|
// Auto-insert "colgroup" element
|
||||||
// Android browser doesn't auto-insert colgroup
|
col: [ 2, "<table>", "</table>" ],
|
||||||
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
|
|
||||||
|
|
||||||
// Auto-insert "tbody" element
|
// Auto-insert "tbody" element
|
||||||
tr: [ 2, "<table>", "</table>" ],
|
tr: [ 2, "<table>", "</table>" ],
|
||||||
|
@ -67,12 +67,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": true,
|
"pixelPosition": true,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
|
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -85,12 +83,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": true,
|
"focusin": true,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": false,
|
"optSelected": false,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": true,
|
"pixelPosition": true,
|
||||||
"radioValue": false,
|
"radioValue": false
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /msie 9\.0/i.test( userAgent ) ) {
|
} else if ( /msie 9\.0/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -103,12 +99,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": true,
|
"focusin": true,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": false,
|
"optSelected": false,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": true,
|
"pixelPosition": true,
|
||||||
"radioValue": false,
|
"radioValue": false
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /chrome/i.test( userAgent ) ) {
|
} else if ( /chrome/i.test( userAgent ) ) {
|
||||||
|
|
||||||
@ -124,12 +118,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": true,
|
"pixelPosition": true,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /8\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
} else if ( /8\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -142,12 +134,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": false,
|
"createHTMLDocument": false,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": false,
|
"pixelPosition": false,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -160,12 +150,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": false,
|
"pixelPosition": false,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /firefox/i.test( userAgent ) ) {
|
} else if ( /firefox/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -178,12 +166,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": true,
|
"pixelPosition": true,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /iphone os 8/i.test( userAgent ) ) {
|
} else if ( /iphone os 8/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -196,12 +182,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": false,
|
"createHTMLDocument": false,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": false,
|
"pixelPosition": false,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
|
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -214,12 +198,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": true,
|
"pixelMarginRight": true,
|
||||||
"pixelPosition": false,
|
"pixelPosition": false,
|
||||||
"radioValue": true,
|
"radioValue": true
|
||||||
"reliableMarginRight": true
|
|
||||||
};
|
};
|
||||||
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
|
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
@ -232,30 +214,10 @@ testIframeWithCallback(
|
|||||||
"createHTMLDocument": true,
|
"createHTMLDocument": true,
|
||||||
"focusin": false,
|
"focusin": false,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
"optSelected": true,
|
||||||
"pixelMarginRight": false,
|
"pixelMarginRight": false,
|
||||||
"pixelPosition": false,
|
"pixelPosition": false,
|
||||||
"radioValue": true,
|
"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
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user