@@ -7,7 +7,7 @@ import pop from "./var/pop.js";
7
7
import push from "./var/push.js" ;
8
8
import whitespace from "./selector/var/whitespace.js" ;
9
9
import rbuggyQSA from "./selector/rbuggyQSA.js" ;
10
- import support from "./selector/support .js" ;
10
+ import isIE from "./var/isIE .js" ;
11
11
12
12
// The following utils are attached directly to the jQuery object.
13
13
import "./selector/contains.js" ;
@@ -131,9 +131,9 @@ var i,
131
131
} ,
132
132
133
133
// Used for iframes; see `setDocument`.
134
- // Support: IE 9 - 11+, Edge 12 - 18+
134
+ // Support: IE 9 - 11+
135
135
// Removing the function wrapper causes a "Permission Denied"
136
- // error in IE/Edge .
136
+ // error in IE.
137
137
unloadHandler = function ( ) {
138
138
setDocument ( ) ;
139
139
} ,
@@ -150,7 +150,7 @@ function selectorError( msg ) {
150
150
}
151
151
152
152
function find ( selector , context , results , seed ) {
153
- var m , i , elem , nid , match , groups , newSelector ,
153
+ var m , i , elem , nid , match , groups , newSelector , canUseScope ,
154
154
newContext = context && context . ownerDocument ,
155
155
156
156
// nodeType defaults to 9, since context defaults to document
@@ -231,9 +231,10 @@ function find( selector, context, results, seed ) {
231
231
232
232
// We can use :scope instead of the ID hack if the browser
233
233
// supports it & if we're not changing the context.
234
- if ( newContext !== context || ! support . scope ) {
234
+ canUseScope = newContext === context && ! isIE ;
235
235
236
- // Capture the context ID, setting it first if necessary
236
+ // Capture the context ID, setting it first if necessary
237
+ if ( ! canUseScope ) {
237
238
if ( ( nid = context . getAttribute ( "id" ) ) ) {
238
239
nid = jQuery . escapeSelector ( nid ) ;
239
240
} else {
@@ -360,7 +361,6 @@ function createDisabledPseudo( disabled ) {
360
361
return elem . isDisabled === disabled ||
361
362
362
363
// Where there is no isDisabled, check manually
363
- /* jshint -W018 */
364
364
elem . isDisabled !== ! disabled &&
365
365
inDisabledFieldset ( elem ) === disabled ;
366
366
}
@@ -419,8 +419,8 @@ function setDocument( node ) {
419
419
doc = node ? node . ownerDocument || node : preferredDoc ;
420
420
421
421
// Return early if doc is invalid or already selected
422
- // Support: IE 11+, Edge 17 - 18+
423
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
422
+ // Support: IE 11+
423
+ // IE sometimes throws a "Permission denied" error when strict-comparing
424
424
// two documents; shallow comparisons work.
425
425
// eslint-disable-next-line eqeqeq
426
426
if ( doc == document || doc . nodeType !== 9 ) {
@@ -432,16 +432,14 @@ function setDocument( node ) {
432
432
documentElement = document . documentElement ;
433
433
documentIsHTML = ! jQuery . isXMLDoc ( document ) ;
434
434
435
- // Support: IE 9 - 11+, Edge 12 - 18+
435
+ // Support: IE 9 - 11+
436
436
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
437
- // Support: IE 11+, Edge 17 - 18+
438
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
437
+ // Support: IE 11+
438
+ // IE sometimes throws a "Permission denied" error when strict-comparing
439
439
// two documents; shallow comparisons work.
440
440
// eslint-disable-next-line eqeqeq
441
- if ( preferredDoc != document &&
441
+ if ( isIE && preferredDoc != document &&
442
442
( subWindow = document . defaultView ) && subWindow . top !== subWindow ) {
443
-
444
- // Support: IE 9 - 11+, Edge 12 - 18+
445
443
subWindow . addEventListener ( "unload" , unloadHandler ) ;
446
444
}
447
445
}
@@ -1410,8 +1408,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
1410
1408
1411
1409
if ( outermost ) {
1412
1410
1413
- // Support: IE 11+, Edge 17 - 18+
1414
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1411
+ // Support: IE 11+
1412
+ // IE sometimes throws a "Permission denied" error when strict-comparing
1415
1413
// two documents; shallow comparisons work.
1416
1414
// eslint-disable-next-line eqeqeq
1417
1415
outermostContext = context == document || context || outermost ;
@@ -1422,8 +1420,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
1422
1420
if ( byElement && elem ) {
1423
1421
j = 0 ;
1424
1422
1425
- // Support: IE 11+, Edge 17 - 18+
1426
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
1423
+ // Support: IE 11+
1424
+ // IE sometimes throws a "Permission denied" error when strict-comparing
1427
1425
// two documents; shallow comparisons work.
1428
1426
// eslint-disable-next-line eqeqeq
1429
1427
if ( ! context && elem . ownerDocument != document ) {
0 commit comments