🌐 AI搜索 & 代理 主页
Skip to content

Commit 38a8406

Browse files
committed
Core: Drop support for IE (all versions)
1 parent 016872f commit 38a8406

Some content is hidden

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

52 files changed

+176
-700
lines changed

Gruntfile.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,6 @@ module.exports = function( grunt ) {
314314
"firefox-debug": {
315315
browsers: [ "Firefox" ],
316316
singleRun: false
317-
},
318-
"ie-debug": {
319-
browsers: [ "IE" ],
320-
singleRun: false
321317
}
322318
},
323319
watch: {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"karma-browserstack-launcher": "1.6.0",
5353
"karma-chrome-launcher": "3.1.1",
5454
"karma-firefox-launcher": "2.1.2",
55-
"karma-ie-launcher": "1.0.0",
5655
"karma-jsdom-launcher": "12.0.0",
5756
"karma-qunit": "4.1.2",
5857
"load-grunt-tasks": "5.1.0",

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
// Convert data if not already a string

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
import "../selector.js";
86

@@ -82,23 +80,6 @@ jQuery.extend( {
8280
}
8381
} );
8482

85-
// Support: IE <=11+
86-
// An input loses its value after becoming a radio
87-
if ( isIE ) {
88-
jQuery.attrHooks.type = {
89-
set: function( elem, value ) {
90-
if ( value === "radio" && nodeName( elem, "input" ) ) {
91-
var val = elem.value;
92-
elem.setAttribute( "type", value );
93-
if ( val ) {
94-
elem.value = val;
95-
}
96-
return value;
97-
}
98-
}
99-
};
100-
}
101-
10283
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
10384
jQuery.attrHooks[ name ] = {
10485
get: function( elem ) {

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
import "../selector.js";
65

@@ -56,7 +55,6 @@ jQuery.extend( {
5655
tabIndex: {
5756
get: function( elem ) {
5857

59-
// Support: IE <=9 - 11+
6058
// elem.tabIndex doesn't always return the
6159
// correct value when it hasn't been explicitly set
6260
// Use proper attribute retrieval (trac-12072)
@@ -87,39 +85,6 @@ jQuery.extend( {
8785
}
8886
} );
8987

90-
// Support: IE <=11+
91-
// Accessing the selectedIndex property forces the browser to respect
92-
// setting selected on the option. The getter ensures a default option
93-
// is selected when in an optgroup. ESLint rule "no-unused-expressions"
94-
// is disabled for this code since it considers such accessions noop.
95-
if ( isIE ) {
96-
jQuery.propHooks.selected = {
97-
get: function( elem ) {
98-
99-
var parent = elem.parentNode;
100-
if ( parent && parent.parentNode ) {
101-
// eslint-disable-next-line no-unused-expressions
102-
parent.parentNode.selectedIndex;
103-
}
104-
return null;
105-
},
106-
set: function( elem ) {
107-
108-
109-
var parent = elem.parentNode;
110-
if ( parent ) {
111-
// eslint-disable-next-line no-unused-expressions
112-
parent.selectedIndex;
113-
114-
if ( parent.parentNode ) {
115-
// eslint-disable-next-line no-unused-expressions
116-
parent.parentNode.selectedIndex;
117-
}
118-
}
119-
}
120-
};
121-
}
122-
12388
jQuery.each( [
12489
"tabIndex",
12590
"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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ jQuery.extend( {
376376
}
377377

378378
// Flatten any nested arrays
379-
return flat( ret );
379+
return flat.call( ret );
380380
},
381381

382382
// A global GUID counter for objects

src/core/isAttached.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
import jQuery from "../core.js";
2-
import documentElement from "../var/documentElement.js";
32

43
import "../selector/contains.js"; // jQuery.contains
54

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

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

2112
export default 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
};

0 commit comments

Comments
 (0)