Skip to content

Commit a76a48b

Browse files
committed
Core: Drop support for IE (all versions)
1 parent 063831b commit a76a48b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+198
-804
lines changed

.github/workflows/browserstack.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
BROWSER:
24-
- 'IE_11'
2524
- 'Safari_latest'
2625
- 'Safari_latest-1'
2726
- 'Chrome_latest'

src/ajax.js

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -455,20 +455,12 @@ jQuery.extend( {
455455
if ( !responseHeaders ) {
456456
responseHeaders = {};
457457
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
458-
459-
// Support: IE 11+
460-
// `getResponseHeader( key )` in IE doesn't combine all header
461-
// values for the provided key into a single result with values
462-
// joined by commas as other browsers do. Instead, it returns
463-
// them on separate lines.
464-
responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
465-
( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
466-
.concat( match[ 2 ] );
458+
responseHeaders[ match[ 1 ].toLowerCase() + " " ] = match[ 2 ];
467459
}
468460
}
469461
match = responseHeaders[ key.toLowerCase() + " " ];
470462
}
471-
return match == null ? null : match.join( ", " );
463+
return match == null ? null : match;
472464
},
473465

474466
// Raw string
@@ -542,24 +534,8 @@ jQuery.extend( {
542534
// A cross-domain request is in order when the origin doesn't match the current origin.
543535
if ( s.crossDomain == null ) {
544536
urlAnchor = document.createElement( "a" );
545-
546-
// Support: IE <=8 - 11+
547-
// IE throws exception on accessing the href property if url is malformed,
548-
// e.g. http://example.com:80x/
549-
try {
550-
urlAnchor.href = s.url;
551-
552-
// Support: IE <=8 - 11+
553-
// Anchor's host property isn't correctly set when s.url is relative
554-
urlAnchor.href = urlAnchor.href;
555-
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
556-
urlAnchor.protocol + "//" + urlAnchor.host;
557-
} catch ( e ) {
558-
559-
// If there is an error parsing the URL, assume it is crossDomain,
560-
// it can be rejected by the transport if it is invalid
561-
s.crossDomain = true;
562-
}
537+
urlAnchor.href = s.url;
538+
s.crossDomain = originAnchor.origin !== urlAnchor.origin;
563539
}
564540

565541
// Apply prefilters

src/ajax/load.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jQuery.fn.load = function( url, params, callback ) {
5050

5151
self.html( selector ?
5252

53-
// If a selector was specified, locate the right elements in a dummy div
54-
// Exclude scripts to avoid IE 'Permission Denied' errors
53+
// If a selector was specified, locate the right elements in a dummy div.
54+
// Exclude scripts.
5555
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
5656

5757
// Otherwise use the full result

src/attributes/attr.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { jQuery } from "../core.js";
22
import { access } from "../core/access.js";
3-
import { nodeName } from "../core/nodeName.js";
43
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
5-
import { isIE } from "../var/isIE.js";
64

75
jQuery.fn.extend( {
86
attr: function( name, value ) {
@@ -86,20 +84,3 @@ jQuery.extend( {
8684
}
8785
}
8886
} );
89-
90-
// Support: IE <=11+
91-
// An input loses its value after becoming a radio
92-
if ( isIE ) {
93-
jQuery.attrHooks.type = {
94-
set: function( elem, value ) {
95-
if ( value === "radio" && nodeName( elem, "input" ) ) {
96-
var val = elem.value;
97-
elem.setAttribute( "type", value );
98-
if ( val ) {
99-
elem.value = val;
100-
}
101-
return value;
102-
}
103-
}
104-
};
105-
}

src/attributes/prop.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { jQuery } from "../core.js";
22
import { access } from "../core/access.js";
3-
import { isIE } from "../var/isIE.js";
43

54
var rfocusable = /^(?:input|select|textarea|button)$/i,
65
rclickable = /^(?:a|area)$/i;
@@ -54,7 +53,6 @@ jQuery.extend( {
5453
tabIndex: {
5554
get: function( elem ) {
5655

57-
// Support: IE <=9 - 11+
5856
// elem.tabIndex doesn't always return the
5957
// correct value when it hasn't been explicitly set
6058
// Use proper attribute retrieval (trac-12072)
@@ -85,39 +83,6 @@ jQuery.extend( {
8583
}
8684
} );
8785

88-
// Support: IE <=11+
89-
// Accessing the selectedIndex property forces the browser to respect
90-
// setting selected on the option. The getter ensures a default option
91-
// is selected when in an optgroup. ESLint rule "no-unused-expressions"
92-
// is disabled for this code since it considers such accessions noop.
93-
if ( isIE ) {
94-
jQuery.propHooks.selected = {
95-
get: function( elem ) {
96-
97-
var parent = elem.parentNode;
98-
if ( parent && parent.parentNode ) {
99-
// eslint-disable-next-line no-unused-expressions
100-
parent.parentNode.selectedIndex;
101-
}
102-
return null;
103-
},
104-
set: function( elem ) {
105-
106-
107-
var parent = elem.parentNode;
108-
if ( parent ) {
109-
// eslint-disable-next-line no-unused-expressions
110-
parent.selectedIndex;
111-
112-
if ( parent.parentNode ) {
113-
// eslint-disable-next-line no-unused-expressions
114-
parent.parentNode.selectedIndex;
115-
}
116-
}
117-
}
118-
};
119-
}
120-
12186
jQuery.each( [
12287
"tabIndex",
12388
"readOnly",

src/attributes/val.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { jQuery } from "../core.js";
2-
import { isIE } from "../var/isIE.js";
3-
import { stripAndCollapse } from "../core/stripAndCollapse.js";
42
import { nodeName } from "../core/nodeName.js";
53

64
import "../core/init.js";
@@ -140,23 +138,6 @@ jQuery.extend( {
140138
}
141139
} );
142140

143-
if ( isIE ) {
144-
jQuery.valHooks.option = {
145-
get: function( elem ) {
146-
147-
var val = elem.getAttribute( "value" );
148-
return val != null ?
149-
val :
150-
151-
// Support: IE <=10 - 11+
152-
// option.text throws exceptions (trac-14686, trac-14858)
153-
// Strip and collapse whitespace
154-
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
155-
stripAndCollapse( jQuery.text( elem ) );
156-
}
157-
};
158-
}
159-
160141
// Radios and checkboxes getter/setter
161142
jQuery.each( [ "radio", "checkbox" ], function() {
162143
jQuery.valHooks[ this ] = {

src/core.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,7 @@ jQuery.extend( {
323323
contains: function( a, b ) {
324324
var bup = b && b.parentNode;
325325

326-
return a === bup || !!( bup && bup.nodeType === 1 && (
327-
328-
// Support: IE 9 - 11+
329-
// IE doesn't have `contains` on SVG.
330-
a.contains ?
331-
a.contains( bup ) :
332-
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
333-
) );
326+
return a === bup || !!( bup && bup.nodeType === 1 && a.contains( bup ) );
334327
},
335328

336329
merge: function( first, second ) {
@@ -395,7 +388,7 @@ jQuery.extend( {
395388
}
396389

397390
// Flatten any nested arrays
398-
return flat( ret );
391+
return flat.call( ret );
399392
},
400393

401394
// A global GUID counter for objects

src/core/isAttached.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
import { jQuery } from "../core.js";
2-
import { documentElement } from "../var/documentElement.js";
32

4-
var isAttached = function( elem ) {
5-
return jQuery.contains( elem.ownerDocument, elem ) ||
6-
elem.getRootNode( composed ) === elem.ownerDocument;
7-
},
8-
composed = { composed: true };
3+
var composed = { composed: true };
94

10-
// Support: IE 9 - 11+
11-
// Check attachment across shadow DOM boundaries when possible (gh-3504).
12-
// Provide a fallback for browsers without Shadow DOM v1 support.
13-
if ( !documentElement.getRootNode ) {
14-
isAttached = function( elem ) {
15-
return jQuery.contains( elem.ownerDocument, elem );
16-
};
5+
export function isAttached( elem ) {
6+
return jQuery.contains( elem.ownerDocument, elem ) ||
7+
elem.getRootNode( composed ) === elem.ownerDocument;
178
}
18-
19-
export { isAttached };

src/core/parseXML.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@ jQuery.parseXML = function( data ) {
77
return null;
88
}
99

10-
// Support: IE 9 - 11+
11-
// IE throws on parseFromString with invalid input.
12-
try {
13-
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
14-
} catch ( e ) {}
10+
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
1511

16-
parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
17-
if ( !xml || parserErrorElem ) {
18-
jQuery.error( "Invalid XML: " + (
19-
parserErrorElem ?
20-
jQuery.map( parserErrorElem.childNodes, function( el ) {
21-
return el.textContent;
22-
} ).join( "\n" ) :
23-
data
24-
) );
12+
parserErrorElem = xml.getElementsByTagName( "parsererror" )[ 0 ];
13+
if ( parserErrorElem ) {
14+
jQuery.error( "Invalid XML: " +
15+
jQuery.map( parserErrorElem.childNodes, function( el ) {
16+
return el.textContent;
17+
} ).join( "\n" )
18+
);
2519
}
2620
return xml;
2721
};

src/css.js

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { jQuery } from "./core.js";
22
import { access } from "./core/access.js";
3+
import { camelCase } from "./core/camelCase.js";
34
import { nodeName } from "./core/nodeName.js";
45
import { rcssNum } from "./var/rcssNum.js";
5-
import { isIE } from "./var/isIE.js";
66
import { rnumnonpx } from "./css/var/rnumnonpx.js";
77
import { rcustomProp } from "./css/var/rcustomProp.js";
88
import { cssExpand } from "./css/var/cssExpand.js";
99
import { isAutoPx } from "./css/isAutoPx.js";
10-
import { cssCamelCase } from "./css/cssCamelCase.js";
1110
import { getStyles } from "./css/var/getStyles.js";
1211
import { swap } from "./css/var/swap.js";
1312
import { curCSS } from "./css/curCSS.js";
@@ -120,8 +119,7 @@ function getWidthOrHeight( elem, dimension, extra ) {
120119

121120
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
122121
// Fake content-box until we know it's needed to know the true value.
123-
boxSizingNeeded = isIE || extra,
124-
isBorderBox = boxSizingNeeded &&
122+
isBorderBox = extra &&
125123
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
126124
valueIsBorderBox = isBorderBox,
127125

@@ -143,14 +141,6 @@ function getWidthOrHeight( elem, dimension, extra ) {
143141
// This happens for inline elements with no explicit setting (gh-3571)
144142
val === "auto" ||
145143

146-
// Support: IE 9 - 11+
147-
// Use offsetWidth/offsetHeight for when box sizing is unreliable.
148-
// In those cases, the computed value can be trusted to be border-box.
149-
( isIE && isBorderBox ) ||
150-
151-
// Support: IE 10 - 11+
152-
// IE misreports `getComputedStyle` of table rows with width/height
153-
// set in CSS while `offset*` properties report correct values.
154144
// Support: Firefox 70+
155145
// Firefox includes border widths
156146
// in computed dimensions for table rows. (gh-4529)
@@ -204,7 +194,7 @@ jQuery.extend( {
204194

205195
// Make sure that we're working with the right name
206196
var ret, type, hooks,
207-
origName = cssCamelCase( name ),
197+
origName = camelCase( name ),
208198
isCustomProp = rcustomProp.test( name ),
209199
style = elem.style;
210200

@@ -240,12 +230,6 @@ jQuery.extend( {
240230
value += ret && ret[ 3 ] || ( isAutoPx( origName ) ? "px" : "" );
241231
}
242232

243-
// Support: IE <=9 - 11+
244-
// background-* props of a cloned element affect the source element (trac-8908)
245-
if ( isIE && value === "" && name.indexOf( "background" ) === 0 ) {
246-
style[ name ] = "inherit";
247-
}
248-
249233
// If a hook was provided, use that value, otherwise just set the specified value
250234
if ( !hooks || !( "set" in hooks ) ||
251235
( value = hooks.set( elem, value, extra ) ) !== undefined ) {
@@ -273,7 +257,7 @@ jQuery.extend( {
273257

274258
css: function( elem, name, extra, styles ) {
275259
var val, num, hooks,
276-
origName = cssCamelCase( name ),
260+
origName = camelCase( name ),
277261
isCustomProp = rcustomProp.test( name );
278262

279263
// Make sure that we're working with the right name. We don't
@@ -316,17 +300,14 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
316300
get: function( elem, computed, extra ) {
317301
if ( computed ) {
318302

319-
// Certain elements can have dimension info if we invisibly show them
303+
// Certain elements can have dimension info if we invisibly show them,
320304
// but it must have a current display style that would benefit
321305
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
322306

323307
// Support: Safari <=8 - 12+, Chrome <=73+
324308
// Table columns in WebKit/Blink have non-zero offsetWidth & zero
325309
// getBoundingClientRect().width unless display is changed.
326-
// Support: IE <=11+
327-
// Running getBoundingClientRect on a disconnected node
328-
// in IE throws an error.
329-
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
310+
!elem.getBoundingClientRect().width ?
330311
swap( elem, cssShow, function() {
331312
return getWidthOrHeight( elem, dimension, extra );
332313
} ) :

0 commit comments

Comments
 (0)