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 | |
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')
-rw-r--r-- | src/selector/rbuggyQSA.js | 32 | ||||
-rw-r--r-- | src/selector/support.js | 11 | ||||
-rw-r--r-- | src/selector/uniqueSort.js | 12 |
3 files changed, 17 insertions, 38 deletions
diff --git a/src/selector/rbuggyQSA.js b/src/selector/rbuggyQSA.js index e9ebbb34e..7a6210733 100644 --- a/src/selector/rbuggyQSA.js +++ b/src/selector/rbuggyQSA.js @@ -1,29 +1,19 @@ -import document from "../var/document.js"; import isIE from "../var/isIE.js"; import whitespace from "./var/whitespace.js"; -var rbuggyQSA = [], - testEl = document.createElement( "div" ), - input = document.createElement( "input" ); +var rbuggyQSA = isIE && new RegExp( -// Support: IE 9 - 11+ -// IE's :disabled selector does not pick up the children of disabled fieldsets -if ( isIE ) { - rbuggyQSA.push( ":enabled", ":disabled" ); -} + // Support: IE 9 - 11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + ":enabled|:disabled|" + -// Support: IE 11+, Edge 15 - 18+ -// IE 11/Edge don't find elements on a `[name='']` query in some cases. -// Adding a temporary attribute to the document before the selection works -// around the issue. -// Interestingly, IE 10 & older don't seem to have the issue. -input.setAttribute( "name", "" ); -testEl.appendChild( input ); -if ( !testEl.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); -} + // Support: IE 11+ + // IE 11 doesn't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" -rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); +); export default rbuggyQSA; diff --git a/src/selector/support.js b/src/selector/support.js deleted file mode 100644 index cc584bf66..000000000 --- a/src/selector/support.js +++ /dev/null @@ -1,11 +0,0 @@ -import document from "../var/document.js"; -import support from "../var/support.js"; - -// Support: IE 9 - 11+, Edge 12 - 18+ -// IE/Edge don't support the :scope pseudo-class. -try { - document.querySelectorAll( ":scope" ); - support.scope = true; -} catch ( e ) {} - -export default support; diff --git a/src/selector/uniqueSort.js b/src/selector/uniqueSort.js index d0bf69198..127cc7068 100644 --- a/src/selector/uniqueSort.js +++ b/src/selector/uniqueSort.js @@ -20,8 +20,8 @@ function sortOrder( a, b ) { } // Calculate position if both inputs belong to the same document - // 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 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? @@ -34,8 +34,8 @@ function sortOrder( a, b ) { if ( compare & 1 ) { // Choose the first element that is related to the document - // 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 ( a == document || a.ownerDocument == document && @@ -43,8 +43,8 @@ function sortOrder( a, b ) { return -1; } - // 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 ( b == document || b.ownerDocument == document && |