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

Commit 630c5cb

Browse files
committed
Core: Drop support for IE (all versions)
1 parent 3cad5c4 commit 630c5cb

Some content is hidden

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

60 files changed

+211
-848
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'

.github/workflows/node.js.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,6 @@ jobs:
8787
- name: Run tests
8888
run: npm run ${{ matrix.NPM_SCRIPT }}
8989

90-
ie:
91-
runs-on: windows-latest
92-
env:
93-
NODE_VERSION: 20.x
94-
name: test:ie - IE
95-
steps:
96-
- name: Checkout
97-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
98-
99-
- name: Use Node.js ${{ env.NODE_VERSION }}
100-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
101-
with:
102-
node-version: ${{ env.NODE_VERSION }}
103-
104-
- name: Cache
105-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
106-
with:
107-
path: ~/.npm
108-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
109-
restore-keys: |
110-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
111-
112-
- name: Install dependencies
113-
run: npm install
114-
115-
- name: Run tests in Edge in IE mode
116-
run: npm run test:ie
117-
11890
safari:
11991
runs-on: macos-latest
12092
env:

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,15 @@ export default [
271271
}
272272
},
273273

274+
{
275+
files: [
276+
"test/jquery.js"
277+
],
278+
languageOptions: {
279+
ecmaVersion: 2020
280+
}
281+
},
282+
274283
{
275284
files: [
276285
"test/unit/deferred.js"

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"test:chrome": "npm run pretest && npm run build:main && npm run test:unit -- -v -b chrome -h",
7575
"test:edge": "npm run pretest && npm run build:main && npm run test:unit -- -v -b edge -h",
7676
"test:firefox": "npm run pretest && npm run build:main && npm run test:unit -- -v -b firefox -h",
77-
"test:ie": "npm run pretest && npm run build:main && npm run test:unit -- -v -b ie",
7877
"test:safari": "npm run pretest && npm run build:main && npm run test:unit -- -b safari",
7978
"test:server": "node test/runner/server.js",
8079
"test:esm": "npm run pretest && npm run build:main && npm run test:unit -- --esm -h",

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

0 commit comments

Comments
 (0)