aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2022-10-11 11:55:46 +0200
committerGitHub <noreply@github.com>2022-10-11 11:55:46 +0200
commit8c7da22caeae8c2c3f7e9869d5f47414669f106c (patch)
tree802691b43d9f7c16579dc721439ae569aa3c5176 /src/selector.js
parentee6e874075ba1fcd8f9e62cd1ee5c04f6518b6d6 (diff)
downloadjquery-8c7da22caeae8c2c3f7e9869d5f47414669f106c.tar.gz
jquery-8c7da22caeae8c2c3f7e9869d5f47414669f106c.zip
Selector: Drop support for legacy pseudos, test custom pseudos
This backports custom pseudos tests from Sizzle; they were missed in original test backports. Also, the support for legacy custom pseudos has been dropped. The `jQuery.expr` test cleanup has been wrapped in `try-finally` for cleaner test isolation in case anything goes wrong. Closes gh-5137
Diffstat (limited to 'src/selector.js')
-rw-r--r--src/selector.js23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/selector.js b/src/selector.js
index 871cf8682..a69e16556 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -804,9 +804,8 @@ Expr = jQuery.expr = {
// https://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- selectorError( "unsupported pseudo: " + pseudo );
+ var fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ selectorError( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
@@ -815,24 +814,6 @@ Expr = jQuery.expr = {
return fn( argument );
}
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction( function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf.call( seed, matched[ i ] );
- seed[ idx ] = !( matches[ idx ] = matched[ i ] );
- }
- } ) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
return fn;
}
},