Commit 40743a89 authored by catch's avatar catch
Browse files

Issue #3462339 by longwave: Update to jQuery 4.0.0-beta2

(cherry picked from commit 7ce2fd1c)
parent 843bfc19
Loading
Loading
Loading
Loading
Loading
+115 −114
Original line number Diff line number Diff line
/*!
 * jQuery JavaScript Library v4.0.0-beta
 * jQuery JavaScript Library v4.0.0-beta.2
 * https://jquery.com/
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2024-02-06T16:40Z
 * Date: 2024-07-17T13:32Z
 */
( function( global, factory ) {

@@ -89,7 +89,7 @@ function isArrayLike( obj ) {
		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}

var document = window.document;
var document$1 = window.document;

var preservedScriptAttributes = {
	type: true,
@@ -99,7 +99,7 @@ var preservedScriptAttributes = {
};

function DOMEval( code, node, doc ) {
	doc = doc || document;
	doc = doc || document$1;

	var i,
		script = doc.createElement( "script" );
@@ -116,7 +116,7 @@ function DOMEval( code, node, doc ) {
	}
}

var version = "4.0.0-beta",
var version = "4.0.0-beta.2",

	rhtmlSuffix = /HTML$/i,

@@ -528,7 +528,7 @@ var pop = arr.pop;
// https://www.w3.org/TR/css3-selectors/#whitespace
var whitespace = "[\\x20\\t\\r\\n\\f]";

var isIE = document.documentMode;
var isIE = document$1.documentMode;

// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
// Make sure the `:has()` argument is parsed unforgivingly.
@@ -540,7 +540,7 @@ var isIE = document.documentMode;
// environments will fail in the qSA path and fall back to jQuery traversal
// anyway.
try {
	document.querySelector( ":has(*,:jqfake)" );
	document$1.querySelector( ":has(*,:jqfake)" );
	support.cssHas = false;
} catch ( e ) {
	support.cssHas = true;
@@ -596,11 +596,11 @@ var rdescend = new RegExp( whitespace + "|>" );

var rsibling = /[+~]/;

var documentElement = document.documentElement;
var documentElement$1 = document$1.documentElement;

// Support: IE 9 - 11+
// IE requires a prefix.
var matches = documentElement.matches || documentElement.msMatchesSelector;
var matches = documentElement$1.matches || documentElement$1.msMatchesSelector;

/**
 * Create key-value caches of limited size
@@ -672,6 +672,7 @@ var filterMatchExpr = {
var rpseudo = new RegExp( pseudos );

// CSS escapes
// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters

var runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
	"?|\\\\([^\\r\\n\\f])", "g" ),
@@ -970,7 +971,14 @@ jQuery.extend( {
		}

		if ( value !== undefined ) {
			if ( value === null ) {
			if ( value === null ||

				// For compat with previous handling of boolean attributes,
				// remove when `false` passed. For ARIA attributes -
				// many of which recognize a `"false"` value - continue to
				// set the `"false"` value as jQuery <4 did.
				( value === false && name.toLowerCase().indexOf( "aria-" ) !== 0 ) ) {

				jQuery.removeAttr( elem, name );
				return;
			}
@@ -1029,35 +1037,6 @@ if ( isIE ) {
	};
}

// HTML boolean attributes have special behavior:
// we consider the lowercase name to be the only valid value, so
// getting (if the attribute is present) normalizes to that, as does
// setting to any non-`false` value (and setting to `false` removes the attribute).
// See https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
jQuery.each( (
	"checked selected async autofocus autoplay controls defer disabled " +
	"hidden ismap loop multiple open readonly required scoped"
).split( " " ), function( _i, name ) {
	jQuery.attrHooks[ name ] = {
		get: function( elem ) {
			return elem.getAttribute( name ) != null ?
				name.toLowerCase() :
				null;
		},

		set: function( elem, value, name ) {
			if ( value === false ) {

				// Remove boolean attributes when set to false
				jQuery.removeAttr( elem, name );
			} else {
				elem.setAttribute( name, name );
			}
			return name;
		}
	};
} );

// CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
@@ -1122,8 +1101,8 @@ function sortOrder( a, b ) {
		// 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 &&
			jQuery.contains( document, a ) ) {
		if ( a == document$1 || a.ownerDocument == document$1 &&
			jQuery.contains( document$1, a ) ) {
			return -1;
		}

@@ -1131,8 +1110,8 @@ function sortOrder( a, b ) {
		// 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 &&
			jQuery.contains( document, b ) ) {
		if ( b == document$1 || b.ownerDocument == document$1 &&
			jQuery.contains( document$1, b ) ) {
			return 1;
		}

@@ -1179,8 +1158,8 @@ var i,
	outermostContext,

	// Local document vars
	document$1,
	documentElement$1,
	document,
	documentElement,
	documentIsHTML,

	// Instance-specific data
@@ -1210,7 +1189,7 @@ var i,
	rheader = /^h\d$/i,

	// Easily-parseable/retrievable ID or TAG or CLASS selectors
	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
	rquickExpr$1 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,

	// Used for iframes; see `setDocument`.
	// Support: IE 9 - 11+
@@ -1246,13 +1225,13 @@ function find( selector, context, results, seed ) {
	// Try to shortcut find operations (as opposed to filters) in HTML documents
	if ( !seed ) {
		setDocument( context );
		context = context || document$1;
		context = context || document;

		if ( documentIsHTML ) {

			// If the selector is sufficiently simple, try using a "get*By*" DOM method
			// (excepting DocumentFragment context, where the methods don't exist)
			if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
			if ( nodeType !== 11 && ( match = rquickExpr$1.exec( selector ) ) ) {

				// ID selector
				if ( ( m = match[ 1 ] ) ) {
@@ -1467,21 +1446,21 @@ function createPositionalPseudo( fn ) {
 */
function setDocument( node ) {
	var subWindow,
		doc = node ? node.ownerDocument || node : document;
		doc = node ? node.ownerDocument || node : document$1;

	// Return early if doc is invalid or already selected
	// Support: IE 11+
	// IE sometimes throws a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( doc == document$1 || doc.nodeType !== 9 ) {
	if ( doc == document || doc.nodeType !== 9 ) {
		return;
	}

	// Update global variables
	document$1 = doc;
	documentElement$1 = document$1.documentElement;
	documentIsHTML = !jQuery.isXMLDoc( document$1 );
	document = doc;
	documentElement = document.documentElement;
	documentIsHTML = !jQuery.isXMLDoc( document );

	// Support: IE 9 - 11+
	// Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
@@ -1489,8 +1468,8 @@ function setDocument( node ) {
	// IE sometimes throws a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( isIE && document != document$1 &&
		( subWindow = document$1.defaultView ) && subWindow.top !== subWindow ) {
	if ( isIE && document$1 != document &&
		( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
		subWindow.addEventListener( "unload", unloadHandler );
	}
}
@@ -1513,7 +1492,7 @@ find.matchesSelector = function( elem, expr ) {
		}
	}

	return find( expr, document$1, null, [ elem ] ).length > 0;
	return find( expr, document, null, [ elem ] ).length > 0;
};

jQuery.expr = {
@@ -1854,12 +1833,12 @@ jQuery.expr = {
		},

		root: function( elem ) {
			return elem === documentElement$1;
			return elem === documentElement;
		},

		focus: function( elem ) {
			return elem === document$1.activeElement &&
				document$1.hasFocus() &&
			return elem === document.activeElement &&
				document.hasFocus() &&
				!!( elem.type || elem.href || ~elem.tabIndex );
		},

@@ -2293,7 +2272,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
				// IE sometimes throws a "Permission denied" error when strict-comparing
				// two documents; shallow comparisons work.
				// eslint-disable-next-line eqeqeq
				outermostContext = context == document$1 || context || outermost;
				outermostContext = context == document || context || outermost;
			}

			// Add elements passing elementMatchers directly to results
@@ -2305,12 +2284,12 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
					// IE sometimes throws a "Permission denied" error when strict-comparing
					// two documents; shallow comparisons work.
					// eslint-disable-next-line eqeqeq
					if ( !context && elem.ownerDocument != document$1 ) {
					if ( !context && elem.ownerDocument != document ) {
						setDocument( elem );
						xml = !documentIsHTML;
					}
					while ( ( matcher = elementMatchers[ j++ ] ) ) {
						if ( matcher( elem, context || document$1, xml ) ) {
						if ( matcher( elem, context || document, xml ) ) {
							push.call( results, elem );
							break;
						}
@@ -2655,7 +2634,7 @@ var rootjQuery,
	// 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$1 = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,

	init = jQuery.fn.init = function( selector, context ) {
		var match, elem;
@@ -2693,7 +2672,7 @@ var rootjQuery,

			// Handle HTML strings or selectors
			} else if ( typeof selector === "string" ) {
				match = rquickExpr$1.exec( selector );
				match = rquickExpr.exec( selector );
			} else {
				return jQuery.makeArray( selector, this );
			}
@@ -2710,7 +2689,7 @@ var rootjQuery,
					// Intentionally let the error be thrown if parseHTML is not present
					jQuery.merge( this, jQuery.parseHTML(
						match[ 1 ],
						context && context.nodeType ? context.ownerDocument || context : document,
						context && context.nodeType ? context.ownerDocument || context : document$1,
						true
					) );

@@ -2733,7 +2712,7 @@ var rootjQuery,

				// HANDLE: $(#id)
				} else {
					elem = document.getElementById( match[ 2 ] );
					elem = document$1.getElementById( match[ 2 ] );

					if ( elem ) {

@@ -2761,7 +2740,7 @@ var rootjQuery,
init.prototype = jQuery.fn;

// Initialize central reference
rootjQuery = jQuery( document );
rootjQuery = jQuery( document$1 );

var rparentsprev = /^(?:parents|prev(?:Until|All))/,

@@ -3622,7 +3601,7 @@ jQuery.extend( {
		}

		// If there are functions bound, to execute
		readyList.resolveWith( document, [ jQuery ] );
		readyList.resolveWith( document$1, [ jQuery ] );
	}
} );

@@ -3630,14 +3609,14 @@ jQuery.ready.then = readyList.then;

// The ready event handler and self cleanup method
function completed() {
	document.removeEventListener( "DOMContentLoaded", completed );
	document$1.removeEventListener( "DOMContentLoaded", completed );
	window.removeEventListener( "load", completed );
	jQuery.ready();
}

// Catch cases where $(document).ready() is called
// after the browser event has already occurred.
if ( document.readyState !== "loading" ) {
if ( document$1.readyState !== "loading" ) {

	// Handle it asynchronously to allow scripts the opportunity to delay ready
	window.setTimeout( jQuery.ready );
@@ -3645,7 +3624,7 @@ if ( document.readyState !== "loading" ) {
} else {

	// Use the handy event callback
	document.addEventListener( "DOMContentLoaded", completed );
	document$1.addEventListener( "DOMContentLoaded", completed );

	// A fallback to window.onload, that will always work
	window.addEventListener( "load", completed );
@@ -4374,7 +4353,7 @@ var isAttached = function( elem ) {
// Support: IE 9 - 11+
// Check attachment across shadow DOM boundaries when possible (gh-3504).
// Provide a fallback for browsers without Shadow DOM v1 support.
if ( !documentElement.getRootNode ) {
if ( !documentElement$1.getRootNode ) {
	isAttached = function( elem ) {
		return jQuery.contains( elem.ownerDocument, elem );
	};
@@ -4728,7 +4707,7 @@ jQuery.event = {
		// Ensure that invalid selectors throw exceptions at attach time
		// Evaluate against documentElement in case elem is a non-element node (e.g., document)
		if ( selector ) {
			jQuery.find.matchesSelector( documentElement, selector );
			jQuery.find.matchesSelector( documentElement$1, selector );
		}

		// Make sure that the handler has a unique ID, used to find/remove it later
@@ -5137,14 +5116,29 @@ function leverageNative( el, type, isSetup ) {
			var result,
				saved = dataPriv.get( this, type );

			// This controller function is invoked under multiple circumstances,
			// differentiated by the stored value in `saved`:
			// 1. For an outer synthetic `.trigger()`ed event (detected by
			//    `event.isTrigger & 1` and non-array `saved`), it records arguments
			//    as an array and fires an [inner] native event to prompt state
			//    changes that should be observed by registered listeners (such as
			//    checkbox toggling and focus updating), then clears the stored value.
			// 2. For an [inner] native event (detected by `saved` being
			//    an array), it triggers an inner synthetic event, records the
			//    result, and preempts propagation to further jQuery listeners.
			// 3. For an inner synthetic event (detected by `event.isTrigger & 1` and
			//    array `saved`), it prevents double-propagation of surrogate events
			//    but otherwise allows everything to proceed (particularly including
			//    further listeners).
			// Possible `saved` data shapes: `[...], `{ value }`, `false`.
			if ( ( event.isTrigger & 1 ) && this[ type ] ) {

				// Interrupt processing of the outer synthetic .trigger()ed event
				if ( !saved ) {
				if ( !saved.length ) {

					// Store arguments for use when handling the inner native event
					// There will always be at least one argument (an event object), so this array
					// will not be confused with a leftover capture object.
					// There will always be at least one argument (an event object),
					// so this array will not be confused with a leftover capture object.
					saved = slice.call( arguments );
					dataPriv.set( this, type, saved );

@@ -5159,29 +5153,35 @@ function leverageNative( el, type, isSetup ) {
						event.stopImmediatePropagation();
						event.preventDefault();

						return result;
					}

				// If this is an inner synthetic event for an event with a bubbling surrogate
				// (focus or blur), assume that the surrogate already propagated from triggering
				// the native event and prevent that from happening again here.
				// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
				// bubbling surrogate propagates *after* the non-bubbling base), but that seems
				// less bad than duplication.
						// Support: Chrome 86+
						// In Chrome, if an element having a focusout handler is
						// blurred by clicking outside of it, it invokes the handler
						// synchronously. If that handler calls `.remove()` on
						// the element, the data is cleared, leaving `result`
						// undefined. We need to guard against this.
						return result && result.value;
					}

				// If this is an inner synthetic event for an event with a bubbling
				// surrogate (focus or blur), assume that the surrogate already
				// propagated from triggering the native event and prevent that
				// from happening again here.
				} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
					event.stopPropagation();
				}

			// If this is a native event triggered above, everything is now in order
			// Fire an inner synthetic event with the original arguments
			} else if ( saved ) {
			// If this is a native event triggered above, everything is now in order.
			// Fire an inner synthetic event with the original arguments.
			} else if ( saved.length ) {

				// ...and capture the result
				dataPriv.set( this, type, jQuery.event.trigger(
				dataPriv.set( this, type, {
					value: jQuery.event.trigger(
						saved[ 0 ],
						saved.slice( 1 ),
						this
				) );
					)
				} );

				// Abort handling of the native event by all jQuery handlers while allowing
				// native handlers on the same element to run. On target, this is achieved
@@ -5884,7 +5884,7 @@ function curCSS( elem, name, computed ) {
}

var cssPrefixes = [ "Webkit", "Moz", "ms" ],
	emptyStyle = document.createElement( "div" ).style,
	emptyStyle = document$1.createElement( "div" ).style,
	vendorProps = {};

// Return a vendor-prefixed property or undefined
@@ -5918,7 +5918,7 @@ function finalPropName( name ) {
( function() {

var reliableTrDimensionsVal,
	div = document.createElement( "div" );
	div = document$1.createElement( "div" );

// Finish early in limited (non-browser) environments
if ( !div.style ) {
@@ -5934,8 +5934,8 @@ if ( !div.style ) {
support.reliableTrDimensions = function() {
	var table, tr, trStyle;
	if ( reliableTrDimensionsVal == null ) {
		table = document.createElement( "table" );
		tr = document.createElement( "tr" );
		table = document$1.createElement( "table" );
		tr = document$1.createElement( "tr" );

		table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
		tr.style.cssText = "box-sizing:content-box;border:1px solid";
@@ -5955,23 +5955,23 @@ support.reliableTrDimensions = function() {
		// gets around this issue.
		div.style.display = "block";

		documentElement
		documentElement$1
			.appendChild( table )
			.appendChild( tr )
			.appendChild( div );

		// Don't run until window is visible
		if ( table.offsetWidth === 0 ) {
			documentElement.removeChild( table );
			documentElement$1.removeChild( table );
			return;
		}

		trStyle = window.getComputedStyle( tr );
		reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
				parseInt( trStyle.borderTopWidth, 10 ) +
				parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
		reliableTrDimensionsVal = ( Math.round( parseFloat( trStyle.height ) ) +
			Math.round( parseFloat( trStyle.borderTopWidth ) ) +
			Math.round( parseFloat( trStyle.borderBottomWidth ) ) ) === tr.offsetHeight;

		documentElement.removeChild( table );
		documentElement$1.removeChild( table );
	}
	return reliableTrDimensionsVal;
};
@@ -6488,7 +6488,7 @@ var

function schedule() {
	if ( inProgress ) {
		if ( document.hidden === false && window.requestAnimationFrame ) {
		if ( document$1.hidden === false && window.requestAnimationFrame ) {
			window.requestAnimationFrame( schedule );
		} else {
			window.setTimeout( schedule, 13 );
@@ -7623,11 +7623,11 @@ jQuery.extend( jQuery.event, {
	trigger: function( event, data, elem, onlyHandlers ) {

		var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
			eventPath = [ elem || document ],
			eventPath = [ elem || document$1 ],
			type = hasOwn.call( event, "type" ) ? event.type : event,
			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];

		cur = lastElement = tmp = elem = elem || document;
		cur = lastElement = tmp = elem = elem || document$1;

		// Don't do events on text and comment nodes
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
@@ -7691,7 +7691,7 @@ jQuery.extend( jQuery.event, {
			}

			// Only add window if we got to document (e.g., not plain obj or detached DOM)
			if ( tmp === ( elem.ownerDocument || document ) ) {
			if ( tmp === ( elem.ownerDocument || document$1 ) ) {
				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
			}
		}
@@ -7982,7 +7982,7 @@ var
	allTypes = "*/".concat( "*" ),

	// Anchor tag for parsing the document origin
	originAnchor = document.createElement( "a" );
	originAnchor = document$1.createElement( "a" );

originAnchor.href = location.href;

@@ -8479,7 +8479,7 @@ jQuery.extend( {

		// A cross-domain request is in order when the origin doesn't match the current origin.
		if ( s.crossDomain == null ) {
			urlAnchor = document.createElement( "a" );
			urlAnchor = document$1.createElement( "a" );

			// Support: IE <=8 - 11+
			// IE throws exception on accessing the href property if url is malformed,
@@ -9090,7 +9090,7 @@ jQuery.ajaxTransport( "script", function( s ) {
					} );

				// Use native DOM manipulation to avoid our domManip AJAX trickery
				document.head.appendChild( script[ 0 ] );
				document$1.head.appendChild( script[ 0 ] );
			},
			abort: function() {
				if ( callback ) {
@@ -9226,13 +9226,13 @@ jQuery.parseHTML = function( data, context, keepScripts ) {

		// Stop scripts or inline event handlers from being executed immediately
		// by using document.implementation
		context = document.implementation.createHTMLDocument( "" );
		context = document$1.implementation.createHTMLDocument( "" );

		// Set the base href for the created document
		// so any parsed elements with URLs
		// are based on the document's URL (gh-2965)
		base = context.createElement( "base" );
		base.href = document.location.href;
		base.href = document$1.location.href;
		context.head.appendChild( base );
	}

@@ -9437,12 +9437,13 @@ jQuery.fn.extend( {
			doc = elem.ownerDocument;
			offsetParent = elem.offsetParent || doc.documentElement;
			while ( offsetParent &&
				( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
				offsetParent !== doc.documentElement &&
				jQuery.css( offsetParent, "position" ) === "static" ) {

				offsetParent = offsetParent.parentNode;
				offsetParent = offsetParent.offsetParent || doc.documentElement;
			}
			if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
			if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 &&
				jQuery.css( offsetParent, "position" ) !== "static" ) {

				// Incorporate borders into its offset, since they are outside its content origin
				parentOffset = jQuery( offsetParent ).offset();
@@ -9476,7 +9477,7 @@ jQuery.fn.extend( {
				offsetParent = offsetParent.offsetParent;
			}

			return offsetParent || documentElement;
			return offsetParent || documentElement$1;
		} );
	}
} );
+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -754,10 +754,10 @@ internal.floating-ui:

jquery:
  remote: https://github.com/jquery/jquery
  version: "4.0.0-beta"
  version: "4.0.0-beta.2"
  license:
    name: MIT
    url: https://raw.githubusercontent.com/jquery/jquery/4.0.0-beta/LICENSE.txt
    url: https://raw.githubusercontent.com/jquery/jquery/4.0.0-beta.2/LICENSE.txt
    gpl-compatible: true
  js:
    assets/vendor/jquery/jquery.min.js: { minified: true, weight: -20 }
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-yml": "^1.14.0",
    "glob": "11.0.0",
    "jquery": "4.0.0-beta",
    "jquery": "^4.0.0-beta.2",
    "jquery-ui": "^1.14.0-beta.2",
    "js-cookie": "^3.0.5",
    "jsdom": "^24.1.0",
Loading