mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Selector: Properly deprecate jQuery.expr[ ":" ]
/jQuery.expr.filters
Some checks failed
Browserstack / ${{ matrix.BROWSER }} (Chrome_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Chrome_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_18) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_102) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_115) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_48) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_60) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_78) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_91) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_9) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Opera_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_12) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_13) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_14) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_15) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_16) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_17) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_8) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_9) (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Has been cancelled
Filestash / Update Filestash (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:amd) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:no-deprecated) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:selector-native) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:slim) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome/Firefox, 20.x, test:browser) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (new), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (old), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 18.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, lint) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 22.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 23.x, test:browserless) (push) Has been cancelled
Node / test:ie - IE (push) Has been cancelled
Node / test:safari - Safari (push) Has been cancelled
Some checks failed
Browserstack / ${{ matrix.BROWSER }} (Chrome_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Chrome_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_18) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Edge_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_102) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_115) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_48) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_60) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_78) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_91) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Firefox_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (IE_9) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Opera_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (Safari_latest-1) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_10) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_11) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_12) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_13) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_14) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_15) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_16) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_17) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_8) (push) Has been cancelled
Browserstack / ${{ matrix.BROWSER }} (__iOS_9) (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Has been cancelled
Filestash / Update Filestash (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:amd) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:no-deprecated) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:selector-native) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome, 20.x, test:slim) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Chrome/Firefox, 20.x, test:browser) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (new), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Firefox ESR (old), 20.x, test:firefox) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 18.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, lint) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 20.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 22.x, test:browserless) (push) Has been cancelled
Node / ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }}) (Node, 23.x, test:browserless) (push) Has been cancelled
Node / test:ie - IE (push) Has been cancelled
Node / test:safari - Safari (push) Has been cancelled
Those APIs have formally been deprecated since `3.0.0`, but they never made its way into the deprecated module. Closes gh-5570 Ref gh-5580
This commit is contained in:
parent
be4f9eccde
commit
5eab9df7b6
@ -86,4 +86,8 @@ jQuery.trim = function( text ) {
|
||||
"" :
|
||||
( text + "" ).replace( rtrim, "$1" );
|
||||
};
|
||||
|
||||
jQuery.expr[ ":" ] = jQuery.expr.filters = jQuery.expr.pseudos;
|
||||
jQuery.unique = jQuery.uniqueSort;
|
||||
|
||||
} );
|
||||
|
@ -124,7 +124,6 @@ jQuery.extend( {
|
||||
// elements in the full selector module. This will be a minor
|
||||
// breaking change in 4.0.0.
|
||||
uniqueSort: uniqueSort,
|
||||
unique: uniqueSort,
|
||||
|
||||
find: function( selector, context, results, seed ) {
|
||||
var elem, nodeType,
|
||||
|
@ -1473,7 +1473,7 @@ for ( i in { submit: true, reset: true } ) {
|
||||
|
||||
// Easy API for creating new setFilters
|
||||
function setFilters() {}
|
||||
setFilters.prototype = Expr.filters = Expr.pseudos;
|
||||
setFilters.prototype = Expr.pseudos;
|
||||
Expr.setFilters = new setFilters();
|
||||
|
||||
function tokenize( selector, parseOnly ) {
|
||||
@ -2092,10 +2092,6 @@ support.sortDetached = assert( function( el ) {
|
||||
|
||||
jQuery.find = find;
|
||||
|
||||
// Deprecated
|
||||
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
|
||||
jQuery.unique = jQuery.uniqueSort;
|
||||
|
||||
// These have always been private, but they used to be documented as part of
|
||||
// Sizzle so let's maintain them for now for backwards compatibility purposes.
|
||||
find.compile = compile;
|
||||
|
@ -704,4 +704,24 @@ if ( includesModule( "deferred" ) ) {
|
||||
} );
|
||||
}
|
||||
|
||||
if ( includesModule( "selector" ) ) {
|
||||
QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ](
|
||||
"jQuery.expr[ \":\" ], jQuery.expr.filters",
|
||||
function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
assert.strictEqual( jQuery.expr[ ":" ], jQuery.expr.pseudos,
|
||||
"jQuery.expr[ \":\" ] is an alias of jQuery.expr.pseudos" );
|
||||
assert.strictEqual( jQuery.expr.filters, jQuery.expr.pseudos,
|
||||
"jQuery.expr.filters is an alias of jQuery.expr.pseudos" );
|
||||
} );
|
||||
}
|
||||
|
||||
QUnit.test( "jQuery.unique", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
assert.strictEqual( jQuery.unique, jQuery.uniqueSort,
|
||||
"jQuery.unique is an alias of jQuery.uniqueSort" );
|
||||
} );
|
||||
|
||||
}
|
||||
|
@ -2346,10 +2346,10 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "custom pseudos", function( as
|
||||
assert.expect( 6 );
|
||||
|
||||
try {
|
||||
jQuery.expr.filters.foundation = jQuery.expr.filters.root;
|
||||
jQuery.expr.pseudos.foundation = jQuery.expr.pseudos.root;
|
||||
assert.deepEqual( jQuery.find( ":foundation" ), [ document.documentElement ], "Copy element filter with new name" );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.foundation;
|
||||
delete jQuery.expr.pseudos.foundation;
|
||||
}
|
||||
|
||||
try {
|
||||
@ -2360,25 +2360,25 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "custom pseudos", function( as
|
||||
}
|
||||
|
||||
try {
|
||||
jQuery.expr.filters.aristotlean = jQuery.expr.createPseudo( function() {
|
||||
jQuery.expr.pseudos.aristotlean = jQuery.expr.createPseudo( function() {
|
||||
return function( elem ) {
|
||||
return !!elem.id;
|
||||
};
|
||||
} );
|
||||
assert.t( "Custom element filter", "#foo :aristotlean", [ "sndp", "en", "yahoo", "sap", "anchor2", "timmy" ] );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.aristotlean;
|
||||
delete jQuery.expr.pseudos.aristotlean;
|
||||
}
|
||||
|
||||
try {
|
||||
jQuery.expr.filters.endswith = jQuery.expr.createPseudo( function( text ) {
|
||||
jQuery.expr.pseudos.endswith = jQuery.expr.createPseudo( function( text ) {
|
||||
return function( elem ) {
|
||||
return jQuery.text( elem ).slice( -text.length ) === text;
|
||||
};
|
||||
} );
|
||||
assert.t( "Custom element filter with argument", "a:endswith(ogle)", [ "google" ] );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.endswith;
|
||||
delete jQuery.expr.pseudos.endswith;
|
||||
}
|
||||
|
||||
try {
|
||||
@ -2392,7 +2392,7 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "custom pseudos", function( as
|
||||
} );
|
||||
assert.t( "Custom set filter", "#qunit-fixture p:second", [ "ap" ] );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.second;
|
||||
delete jQuery.expr.setFilters.second;
|
||||
}
|
||||
|
||||
try {
|
||||
@ -2412,7 +2412,7 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "custom pseudos", function( as
|
||||
} );
|
||||
assert.t( "Custom set filter with argument", "#qunit-fixture p:slice(1:3)", [ "ap", "sndp" ] );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.slice;
|
||||
delete jQuery.expr.setFilters.slice;
|
||||
}
|
||||
} );
|
||||
|
||||
@ -2420,12 +2420,12 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "backwards-compatible custom p
|
||||
assert.expect( 3 );
|
||||
|
||||
try {
|
||||
jQuery.expr.filters.icontains = function( elem, i, match ) {
|
||||
jQuery.expr.pseudos.icontains = function( elem, i, match ) {
|
||||
return jQuery.text( elem ).toLowerCase().indexOf( ( match[ 3 ] || "" ).toLowerCase() ) > -1;
|
||||
};
|
||||
assert.t( "Custom element filter with argument", "a:icontains(THIS BLOG ENTRY)", [ "john1" ] );
|
||||
} finally {
|
||||
delete jQuery.expr.filters.icontains;
|
||||
delete jQuery.expr.pseudos.icontains;
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user