Skip to content

Commit ce3b4a6

Browse files
committed
Ajax:Attributes:CSS:Manipulation: Reduce Android 2.3 support
Drop non-critical workarounds for Android 2.3. Fixes jquerygh-2483 Fixes jquerygh-2505 Closes jquerygh-2581
1 parent 64fd7ef commit ce3b4a6

File tree

7 files changed

+15
-105
lines changed

7 files changed

+15
-105
lines changed

src/ajax/parseJSON.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ define( [
22
"../core"
33
], function( jQuery ) {
44

5-
// Support: Android 2.3
6-
// Workaround failure to string-cast null input
7-
jQuery.parseJSON = function( data ) {
8-
return JSON.parse( data + "" );
9-
};
5+
jQuery.parseJSON = JSON.parse;
106

117
return jQuery.parseJSON;
128

src/attributes/support.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ define( [
1818
// Must access selectedIndex to make default options select
1919
support.optSelected = opt.selected;
2020

21-
// Support: Android<=2.3
22-
// Options inside disabled selects are incorrectly marked as disabled
23-
select.disabled = true;
24-
support.optDisabled = !opt.disabled;
25-
2621
// Support: IE<=11+
2722
// An input loses its value after becoming a radio
2823
input = document.createElement( "input" );

src/attributes/val.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ jQuery.extend( {
105105
if ( ( option.selected || i === index ) &&
106106

107107
// Don't return options that are disabled or in a disabled optgroup
108-
( support.optDisabled ?
109-
!option.disabled : option.getAttribute( "disabled" ) === null ) &&
108+
!option.disabled &&
110109
( !option.parentNode.disabled ||
111110
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
112111

src/css.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,6 @@ jQuery.each( [ "height", "width" ], function( i, name ) {
351351
};
352352
} );
353353

354-
// Support: Android 2.3
355-
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
356-
function( elem, computed ) {
357-
if ( computed ) {
358-
return swap( elem, { "display": "inline-block" },
359-
curCSS, [ elem, "marginRight" ] );
360-
}
361-
}
362-
);
363-
364354
// These hooks are used by animate to expand properties
365355
jQuery.each( {
366356
margin: "",

src/css/support.js

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ define( [
2929
// so they're executed at the same time to save the second computation.
3030
function computeStyleTests() {
3131
div.style.cssText =
32-
33-
// Support: Android 2.3
34-
// Vendor-prefix box-sizing
35-
"-webkit-box-sizing:border-box;box-sizing:border-box;" +
32+
"box-sizing:border-box;" +
3633
"display:block;position:absolute;" +
3734
"margin:0;margin-top:1%;margin-right:50%;" +
3835
"border:1px;padding:1px;" +
@@ -72,34 +69,6 @@ define( [
7269
computeStyleTests();
7370
}
7471
return pixelMarginRightVal;
75-
},
76-
reliableMarginRight: function() {
77-
78-
// Support: Android 2.3
79-
// Check if div with explicit width and no margin-right incorrectly
80-
// gets computed margin-right based on width of container. (#3333)
81-
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
82-
// This support function is only executed once so no memoizing is needed.
83-
var ret,
84-
marginDiv = div.appendChild( document.createElement( "div" ) );
85-
86-
// Reset CSS: box-sizing; display; margin; border; padding
87-
marginDiv.style.cssText = div.style.cssText =
88-
89-
// Support: Android 2.3
90-
// Vendor-prefix box-sizing
91-
"-webkit-box-sizing:content-box;box-sizing:content-box;" +
92-
"display:block;margin:0;border:0;padding:0";
93-
marginDiv.style.marginRight = marginDiv.style.width = "0";
94-
div.style.width = "1px";
95-
documentElement.appendChild( container );
96-
97-
ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
98-
99-
documentElement.removeChild( container );
100-
div.removeChild( marginDiv );
101-
102-
return ret;
10372
}
10473
} );
10574
} )();

src/manipulation/wrapMap.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ var wrapMap = {
1212
// their parent elements (except for "table" element) could be omitted
1313
// since browser parsers are smart enough to auto-insert them
1414

15-
// Support: Android 2.3
16-
// Android browser doesn't auto-insert colgroup
17-
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
15+
// Auto-insert "colgroup" element
16+
col: [ 2, "<table>", "</table>" ],
1817

1918
// Auto-insert "tbody" element
2019
tr: [ 2, "<table>", "</table>" ],

test/unit/support.js

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ testIframeWithCallback(
6767
"createHTMLDocument": true,
6868
"focusin": false,
6969
"noCloneChecked": true,
70-
"optDisabled": true,
7170
"optSelected": true,
7271
"pixelMarginRight": true,
7372
"pixelPosition": true,
74-
"radioValue": true,
75-
"reliableMarginRight": true
73+
"radioValue": true
7674
};
7775
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
7876
expected = {
@@ -85,12 +83,10 @@ testIframeWithCallback(
8583
"createHTMLDocument": true,
8684
"focusin": true,
8785
"noCloneChecked": false,
88-
"optDisabled": true,
8986
"optSelected": false,
9087
"pixelMarginRight": true,
9188
"pixelPosition": true,
92-
"radioValue": false,
93-
"reliableMarginRight": true
89+
"radioValue": false
9490
};
9591
} else if ( /msie 9\.0/i.test( userAgent ) ) {
9692
expected = {
@@ -103,12 +99,10 @@ testIframeWithCallback(
10399
"createHTMLDocument": true,
104100
"focusin": true,
105101
"noCloneChecked": false,
106-
"optDisabled": true,
107102
"optSelected": false,
108103
"pixelMarginRight": true,
109104
"pixelPosition": true,
110-
"radioValue": false,
111-
"reliableMarginRight": true
105+
"radioValue": false
112106
};
113107
} else if ( /chrome/i.test( userAgent ) ) {
114108

@@ -124,12 +118,10 @@ testIframeWithCallback(
124118
"createHTMLDocument": true,
125119
"focusin": false,
126120
"noCloneChecked": true,
127-
"optDisabled": true,
128121
"optSelected": true,
129122
"pixelMarginRight": true,
130123
"pixelPosition": true,
131-
"radioValue": true,
132-
"reliableMarginRight": true
124+
"radioValue": true
133125
};
134126
} else if ( /8\.0(\.\d+|) safari/i.test( userAgent ) ) {
135127
expected = {
@@ -142,12 +134,10 @@ testIframeWithCallback(
142134
"createHTMLDocument": false,
143135
"focusin": false,
144136
"noCloneChecked": true,
145-
"optDisabled": true,
146137
"optSelected": true,
147138
"pixelMarginRight": true,
148139
"pixelPosition": false,
149-
"radioValue": true,
150-
"reliableMarginRight": true
140+
"radioValue": true
151141
};
152142
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
153143
expected = {
@@ -160,12 +150,10 @@ testIframeWithCallback(
160150
"createHTMLDocument": true,
161151
"focusin": false,
162152
"noCloneChecked": true,
163-
"optDisabled": true,
164153
"optSelected": true,
165154
"pixelMarginRight": true,
166155
"pixelPosition": false,
167-
"radioValue": true,
168-
"reliableMarginRight": true
156+
"radioValue": true
169157
};
170158
} else if ( /firefox/i.test( userAgent ) ) {
171159
expected = {
@@ -178,12 +166,10 @@ testIframeWithCallback(
178166
"createHTMLDocument": true,
179167
"focusin": false,
180168
"noCloneChecked": true,
181-
"optDisabled": true,
182169
"optSelected": true,
183170
"pixelMarginRight": true,
184171
"pixelPosition": true,
185-
"radioValue": true,
186-
"reliableMarginRight": true
172+
"radioValue": true
187173
};
188174
} else if ( /iphone os 8/i.test( userAgent ) ) {
189175
expected = {
@@ -196,12 +182,10 @@ testIframeWithCallback(
196182
"createHTMLDocument": false,
197183
"focusin": false,
198184
"noCloneChecked": true,
199-
"optDisabled": true,
200185
"optSelected": true,
201186
"pixelMarginRight": true,
202187
"pixelPosition": false,
203-
"radioValue": true,
204-
"reliableMarginRight": true
188+
"radioValue": true
205189
};
206190
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
207191
expected = {
@@ -214,12 +198,10 @@ testIframeWithCallback(
214198
"createHTMLDocument": true,
215199
"focusin": false,
216200
"noCloneChecked": true,
217-
"optDisabled": true,
218201
"optSelected": true,
219202
"pixelMarginRight": true,
220203
"pixelPosition": false,
221-
"radioValue": true,
222-
"reliableMarginRight": true
204+
"radioValue": true
223205
};
224206
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
225207
expected = {
@@ -232,30 +214,10 @@ testIframeWithCallback(
232214
"createHTMLDocument": true,
233215
"focusin": false,
234216
"noCloneChecked": true,
235-
"optDisabled": true,
236217
"optSelected": true,
237218
"pixelMarginRight": false,
238219
"pixelPosition": false,
239-
"radioValue": true,
240-
"reliableMarginRight": true
241-
};
242-
} else if ( /android 2\.3/i.test( userAgent ) ) {
243-
expected = {
244-
"ajax": true,
245-
"boxSizingReliable": true,
246-
"checkClone": true,
247-
"checkOn": false,
248-
"clearCloneStyle": false,
249-
"cors": true,
250-
"createHTMLDocument": true,
251-
"focusin": false,
252-
"noCloneChecked": true,
253-
"optDisabled": false,
254-
"optSelected": true,
255-
"pixelMarginRight": true,
256-
"pixelPosition": false,
257-
"radioValue": true,
258-
"reliableMarginRight": false
220+
"radioValue": true
259221
};
260222
}
261223

0 commit comments

Comments
 (0)