🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ In the spirit of open source software development, jQuery always encourages comm
2. [Core Style Guide](https://contribute.jquery.org/style-guide/js/)
3. [Writing Code for jQuery Foundation Projects](https://contribute.jquery.org/code/)

### References to issues/PRs

GitHub issues/PRs are usually referenced via `gh-NUMBER`, where `NUMBER` is the numerical ID of the issue/PR. You can find such an issue/PR under `https://github.com/jquery/jquery/issues/NUMBER`.

jQuery has used a different bug tracker - based on Trac - in the past, available under [bugs.jquery.com](https://bugs.jquery.com/). It is being kept in read only mode so that referring to past discussions is possible. When jQuery source references one of those issues, it uses the pattern `trac-NUMBER`, where `NUMBER` is the numerical ID of the issue. You can find such an issue under `https://bugs.jquery.com/ticket/NUMBER`.


Environments in which to use jQuery
--------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var
rantiCache = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,

// #7653, #8125, #8152: local protocol detection
// trac-7653, trac-8125, trac-8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
Expand All @@ -40,7 +40,7 @@ var
*/
transports = {},

// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
allTypes = "*/".concat( "*" ),

// Anchor tag for parsing the document origin
Expand Down Expand Up @@ -111,7 +111,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX

// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
// Fixes trac-9887
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
Expand Down Expand Up @@ -528,12 +528,12 @@ jQuery.extend( {
deferred.promise( jqXHR );

// Add protocol if not provided (prefilters might expect it)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// Handle falsy url in the settings object (trac-10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || location.href ) + "" )
.replace( rprotocol, location.protocol + "//" );

// Alias method option to type as per ticket #12004
// Alias method option to type as per ticket trac-12004
s.type = options.method || options.type || s.method || s.type;

// Extract dataTypes list
Expand Down Expand Up @@ -605,7 +605,7 @@ jQuery.extend( {
if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;

// #9682: remove data so that it's not used in an eventual retry
// trac-9682: remove data so that it's not used in an eventual retry
delete s.data;
}

Expand Down
4 changes: 2 additions & 2 deletions src/ajax/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jQuery.ajaxTransport( function( options ) {
} else if ( type === "error" ) {
complete(

// File: protocol always yields status 0; see #8605, #14207
// File: protocol always yields status 0; see trac-8605, trac-14207
xhr.status,
xhr.statusText
);
Expand Down Expand Up @@ -99,7 +99,7 @@ jQuery.ajaxTransport( function( options ) {
xhr.send( options.hasContent && options.data || null );
} catch ( e ) {

// #14683: Only rethrow if this hasn't been notified as an error yet
// trac-14683: Only rethrow if this hasn't been notified as an error yet
if ( callback ) {
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jQuery.extend( {
// elem.tabIndex doesn't always return the
// correct value when it hasn't been explicitly set
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
// Use proper attribute retrieval(#12072)
// Use proper attribute retrieval (trac-12072)
var tabindex = elem.getAttribute( "tabindex" );

if ( tabindex ) {
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/val.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if ( isIE ) {
val :

// Support: IE <=10 - 11+
// option.text throws exceptions (#14686, #14858)
// option.text throws exceptions (trac-14686, trac-14858)
// Strip and collapse whitespace
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
stripAndCollapse( jQuery.text( elem ) );
Expand Down
4 changes: 2 additions & 2 deletions src/core/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "../traversing/findFilter.js";
var rootjQuery,

// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
// Strict HTML recognition (trac-11290: must start with <)
// Shortcut simple #id case for speed
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,

Expand Down
2 changes: 1 addition & 1 deletion src/core/ready-no-deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jQuery.extend( {
isReady: false,

// A counter to track how many items to wait for before
// the ready event fires. See #6781
// the ready event fires. See trac-6781
readyWait: 1,

ready: function( wait ) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jQuery.extend( {
isReady: false,

// A counter to track how many items to wait for before
// the ready event fires. See #6781
// the ready event fires. See trac-6781
readyWait: 1,

// Handle when the DOM is ready
Expand Down
8 changes: 4 additions & 4 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ jQuery.extend( {
if ( value !== undefined ) {
type = typeof value;

// Convert "+=" or "-=" to relative numbers (#7345)
// Convert "+=" or "-=" to relative numbers (trac-7345)
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
value = adjustCSS( elem, name, ret );

// Fixes bug #9237
// Fixes bug trac-9237
type = "number";
}

// Make sure that null and NaN values aren't set (#7116)
// Make sure that null and NaN values aren't set (trac-7116)
if ( value == null || value !== value ) {
return;
}
Expand All @@ -239,7 +239,7 @@ jQuery.extend( {
}

// Support: IE <=9 - 11+
// background-* props of a cloned element affect the source element (#8908)
// background-* props of a cloned element affect the source element (trac-8908)
if ( isIE && value === "" && name.indexOf( "background" ) === 0 ) {
style[ name ] = "inherit";
}
Expand Down
2 changes: 1 addition & 1 deletion src/css/cssCamelCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var rmsPrefix = /^-ms-/;
// Convert dashed to camelCase, handle vendor prefixes.
// Used by the css & effects modules.
// Support: IE <=9 - 11+
// Microsoft forgot to hump their vendor prefix (#9572)
// Microsoft forgot to hump their vendor prefix (trac-9572)
function cssCamelCase( string ) {
return camelCase( string.replace( rmsPrefix, "ms-" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jQuery.fn.extend( {
while ( i-- ) {

// Support: IE 11+
// The attrs elements can be null (#14894)
// The attrs elements can be null (trac-14894)
if ( attrs[ i ] ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/data/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Data.prototype = {
value = Object.create( null );

// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// but we should not, see trac-8335.
// Always return an empty object.
if ( acceptData( owner ) ) {

Expand Down
6 changes: 3 additions & 3 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ jQuery.event = {

for ( ; cur !== this; cur = cur.parentNode || this ) {

// Don't check non-elements (#13208)
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
// Don't check non-elements (trac-13208)
// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
matchedHandlers = [];
matchedSelectors = {};
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];

// Don't conflict with Object.prototype properties (#13203)
// Don't conflict with Object.prototype properties (trac-13203)
sel = handleObj.selector + " ";

if ( matchedSelectors[ sel ] === undefined ) {
Expand Down
6 changes: 3 additions & 3 deletions src/event/trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jQuery.extend( jQuery.event, {
return;
}

// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
// Determine event propagation path in advance, per W3C events spec (trac-9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {

bubbleType = special.delegateType || type;
Expand Down Expand Up @@ -124,7 +124,7 @@ jQuery.extend( jQuery.event, {
acceptData( elem ) ) {

// Call a native DOM method on the target with the same name as the event.
// Don't do default actions on window, that's where global variables be (#6170)
// Don't do default actions on window, that's where global variables be (trac-6170)
if ( ontype && typeof elem[ type ] === "function" && !isWindow( elem ) ) {

// Don't re-trigger an onFOO event when we call its FOO() method
Expand Down
4 changes: 2 additions & 2 deletions src/exports/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jQuery.noConflict = function( deep ) {
};

// Expose jQuery and $ identifiers, even in AMD
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566)
// (trac-7102#comment:10, gh-557)
// and CommonJS for browser emulators (trac-13566)
if ( typeof noGlobal === "undefined" ) {
window.jQuery = window.$ = jQuery;
}
2 changes: 1 addition & 1 deletion src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function domManip( collection, args, callback, ignored ) {

// Use the original fragment for the last item
// instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
// being emptied incorrectly in certain situations (trac-8070).
for ( ; i < l; i++ ) {
node = fragment;

Expand Down
2 changes: 1 addition & 1 deletion src/manipulation/_evalUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jQuery._evalUrl = function( url, options, doc ) {
return jQuery.ajax( {
url: url,

// Make this explicit, since user can override this through ajaxSetup (#11264)
// Make this explicit, since user can override this through ajaxSetup (trac-11264)
type: "GET",
dataType: "script",
cache: true,
Expand Down
2 changes: 1 addition & 1 deletion src/manipulation/buildFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
// Remember the top-level container
tmp = fragment.firstChild;

// Ensure the created nodes are orphaned (#12392)
// Ensure the created nodes are orphaned (trac-12392)
tmp.textContent = "";
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/manipulation/getAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import nodeName from "../core/nodeName.js";
function getAll( context, tag ) {

// Support: IE <=9 - 11+
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
var ret;

if ( typeof context.getElementsByTagName !== "undefined" ) {
Expand Down
11 changes: 7 additions & 4 deletions src/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ function createCache() {

function cache( key, value ) {

// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
// Use (key + " ") to avoid collision with native prototype properties
// (see https://github.com/jquery/sizzle/issues/157)
if ( keys.push( key + " " ) > Expr.cacheLength ) {

// Only keep the most recent entries
Expand Down Expand Up @@ -432,7 +433,7 @@ function setDocument( node ) {
documentIsHTML = !jQuery.isXMLDoc( document );

// Support: IE 9 - 11+
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
// Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
Expand Down Expand Up @@ -843,7 +844,8 @@ Expr = jQuery.expr = {
input[ 0 ] = elem;
matcher( input, null, xml, results );

// Don't keep the element (issue #299)
// Don't keep the element
// (see https://github.com/jquery/sizzle/issues/299)
input[ 0 ] = null;
return !results.pop();
};
Expand Down Expand Up @@ -1348,7 +1350,8 @@ function matcherFromTokens( tokens ) {
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );

// Avoid hanging onto element (issue #299)
// Avoid hanging onto element
// (see https://github.com/jquery/sizzle/issues/299)
checkContext = null;
return ret;
} ];
Expand Down
2 changes: 1 addition & 1 deletion src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
// See ticket trac-14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
Expand Down
2 changes: 1 addition & 1 deletion test/data/ajax/onunload.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>onunload ajax requests (#14379)</title>
<title>onunload ajax requests (trac-14379)</title>
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion test/data/core/aliased.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>alias-masked DOM properties (#14074)</title>
<title>alias-masked DOM properties (trac-14074)</title>
<script>
var errors = [];
window.onerror = function( errorMessage, filePath, lineNumber ) {
Expand Down
4 changes: 2 additions & 2 deletions test/data/core/onready.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>alias-masked DOM properties (#14074)</title>
<title>alias-masked DOM properties (trac-14074)</title>
<script>
var error = false;
window.onready = function() { error = "Called window.onready"; };
Expand All @@ -22,4 +22,4 @@
});
</script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions test/data/data/dataAttrs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IE11 onpageshow strangeness (#14894)</title>
<title>IE11 onpageshow strangeness (trac-14894)</title>
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script>
Expand All @@ -12,6 +12,6 @@
</script>
</head>
<body x-what="test" data-result="ok" onload="x=1" onpageshow="x=1">
Test for #14894
Test for trac-14894
</body>
</html>
2 changes: 1 addition & 1 deletion test/data/event/focusElem.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>.focus() (activeElement access #13393)</title>
<title>.focus() (activeElement access trac-13393)</title>

<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/data/event/focusinCrossFrame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>focusin event cross-frame (#14180)</title>
<title>focusin event cross-frame (trac-14180)</title>

<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/data/event/promiseReady.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Test case for jQuery ticket #11470</title>
<title>Test case for jQuery ticket trac-11470</title>
<script src="../../jquery.js"></script>
<script src="../iframeTest.js"></script>
<script type="text/javascript">
Expand Down
Loading