From e35fb62db4fb46f031056bb53e393982c03972a1 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Tue, 22 Sep 2020 17:49:28 +0200 Subject: 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 --- src/selector/rbuggyQSA.js | 32 +++++++++++--------------------- src/selector/support.js | 11 ----------- src/selector/uniqueSort.js | 12 ++++++------ 3 files changed, 17 insertions(+), 38 deletions(-) delete mode 100644 src/selector/support.js (limited to 'src/selector') 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 && -- cgit v1.2.3