]> source.dussan.org Git - jquery.git/commitdiff
Ajax:Attributes:CSS:Manipulation: Reduce Android 2.3 support 2581/head
authorMichał Gołębiowski <m.goleb@gmail.com>
Mon, 20 Jul 2015 17:24:46 +0000 (19:24 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 14 Sep 2015 19:26:48 +0000 (21:26 +0200)
Drop non-critical workarounds for Android 2.3.

Fixes gh-2483
Fixes gh-2505
Closes gh-2581

src/ajax/parseJSON.js
src/attributes/support.js
src/attributes/val.js
src/css.js
src/css/support.js
src/manipulation/wrapMap.js
test/unit/support.js

index 11918b06d6817bc7b258d96e94bf361b98fe70b4..c2aeb6aaecbd94d690cfe288a153ecb9f3ac49d3 100644 (file)
@@ -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;
 
index 13bcd457220fa38b0f210b92548a3bb3a3ff8d88..f93ba0181612d419c3a358c6ec18293ebe6be5f5 100644 (file)
@@ -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" );
index 9999d985b622e6de1ca33be36b7d6cf2d71c6f47..caf0126d4cfaa08a0b47e157b3b3b648cd483684 100644 (file)
@@ -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" ) ) ) {
 
index 8a86ef55c8ae39784e0eaeed8cef332550d213e3..ccf0cc85e1ca6981da8a2121994039cd95221769 100644 (file)
@@ -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: "",
index 0758fa8a410843980939b4413669c574e1884464..08560b42aa6e72df3496162e04c98f9bb8974d95 100644 (file)
@@ -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;
                }
        } );
 } )();
index 3fa5f913e65d0e7ed18054223587af5e4b4a3bcf..a7b913c90315ef03f96c2c43b0ea8a8d752bc6f3 100644 (file)
@@ -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>" ],
index e53a5f0ec031eef27898ca0e216b4512ae39c039..8c6b0a28b62cf74a4c0ba6b6e706205bb79cde49 100644 (file)
@@ -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
                };
        }