diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-09-22 17:49:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 17:49:28 +0200 |
commit | e35fb62db4fb46f031056bb53e393982c03972a1 (patch) | |
tree | ae55e7e05133da5637d188d73c312c4538d8b5b4 /src/selector.js | |
parent | 15ae361485056b236a9484a185238f992806e1ff (diff) | |
download | jquery-e35fb62db4fb46f031056bb53e393982c03972a1.tar.gz jquery-e35fb62db4fb46f031056bb53e393982c03972a1.zip |
Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)
Drop support for Edge Legacy: the non-Chromium, EdgeHTML-based Microsoft
Edge version. Also, restrict some workarounds that were applied
unconditionally in all browsers to run only in IE now. This slightly
increases the size but reduces the performance burden on modern browsers
that don't need the workarounds.
Also, clean up some comments & remove some obsolete workarounds.
Fixes gh-4568
Closes gh-4792
Diffstat (limited to 'src/selector.js')
-rw-r--r-- | src/selector.js | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/selector.js b/src/selector.js index 0d80c6fd3..f7e8d9b60 100644 --- a/src/selector.js +++ b/src/selector.js @@ -7,7 +7,7 @@ import pop from "./var/pop.js"; import push from "./var/push.js"; import whitespace from "./selector/var/whitespace.js"; import rbuggyQSA from "./selector/rbuggyQSA.js"; -import support from "./selector/support.js"; +import isIE from "./var/isIE.js"; // The following utils are attached directly to the jQuery object. import "./selector/contains.js"; @@ -131,9 +131,9 @@ var i, }, // Used for iframes; see `setDocument`. - // Support: IE 9 - 11+, Edge 12 - 18+ + // Support: IE 9 - 11+ // Removing the function wrapper causes a "Permission Denied" - // error in IE/Edge. + // error in IE. unloadHandler = function() { setDocument(); }, @@ -229,9 +229,9 @@ function find( selector, context, results, seed ) { newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { + // Outside of IE, if we're not changing the context we can + // use :scope instead of an ID. + if ( newContext !== context || isIE ) { // Capture the context ID, setting it first if necessary if ( ( nid = context.getAttribute( "id" ) ) ) { @@ -360,7 +360,6 @@ function createDisabledPseudo( disabled ) { return elem.isDisabled === disabled || // Where there is no isDisabled, check manually - /* jshint -W018 */ elem.isDisabled !== !disabled && inDisabledFieldset( elem ) === disabled; } @@ -419,8 +418,8 @@ function setDocument( node ) { doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // Support: IE 11+ + // IE sometimes throws a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( doc == document || doc.nodeType !== 9 ) { @@ -432,16 +431,14 @@ function setDocument( node ) { documentElement = document.documentElement; documentIsHTML = !jQuery.isXMLDoc( document ); - // Support: IE 9 - 11+, Edge 12 - 18+ + // Support: IE 9 - 11+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // Support: IE 11+ + // IE sometimes throws a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && + if ( isIE && preferredDoc != document && ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 9 - 11+, Edge 12 - 18+ subWindow.addEventListener( "unload", unloadHandler ); } } @@ -928,7 +925,7 @@ Expr = jQuery.expr = { // Accessing the selectedIndex property // forces the browser to treat the default option as // selected when in an optgroup. - if ( elem.parentNode ) { + if ( isIE && elem.parentNode ) { // eslint-disable-next-line no-unused-expressions elem.parentNode.selectedIndex; } @@ -1412,8 +1409,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { if ( outermost ) { - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // Support: IE 11+ + // IE sometimes throws a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq outermostContext = context == document || context || outermost; @@ -1424,8 +1421,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { if ( byElement && elem ) { j = 0; - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // Support: IE 11+ + // IE sometimes throws a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( !context && elem.ownerDocument != document ) { |