: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
Object.defineProperty( owner, this.expando, {
set: function( owner, data, value ) {
cache = this.cache( owner );
// Handle: [ owner, key, value ] args
// Always use camelCase key (gh-2257)
if ( typeof data === "string" ) {
cache[ camelCase( data ) ] = value;
// Handle: [ owner, { properties } ] args
// Copy the properties one-by-one to the cache object
cache[ camelCase( prop ) ] = data[ prop ];
get: function( owner, key ) {
return key === undefined ?
// Always use camelCase key (gh-2257)
owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
access: function( owner, key, value ) {
// In cases where either:
// 1. No key was specified
// 2. A string key was specified, but no value provided
// Take the "read" path and allow the get method to determine
// which value to return, respectively either:
// 1. The entire cache object
// 2. The data stored at the key
if ( key === undefined ||
( ( key && typeof key === "string" ) && value === undefined ) ) {
return this.get( owner, key );
// When the key is not a string, or both a key and value
// are specified, set or extend (existing objects) with either:
// 1. An object of properties
this.set( owner, key, value );
// Since the "set" path can have two possible entry points
// return the expected data based on which path was taken[*]
return value !== undefined ? value : key;
remove: function( owner, key ) {
cache = owner[ this.expando ];
if ( cache === undefined ) {
if ( key !== undefined ) {
// Support array or space separated string of keys
if ( Array.isArray( key ) ) {
// If key is an array of keys...
// We always set camelCase keys, so remove that.
key = key.map( camelCase );
// If a key with the spaces exists, use it.
// Otherwise, create an array by matching non-whitespace
( key.match( rnothtmlwhite ) || [] );
delete cache[ key[ i ] ];
// Remove the expando if there's no more data
if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
// Support: Chrome <=35 - 45
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
owner[ this.expando ] = undefined;
delete owner[ this.expando ];
hasData: function( owner ) {
var cache = owner[ this.expando ];
return cache !== undefined && !jQuery.isEmptyObject( cache );
var dataPriv = new Data();
var dataUser = new Data();
// Implementation Summary
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
// 2. Improve the module's maintainability by reducing the storage
// paths to a single mechanism.
// 3. Use the same single mechanism to support "private" and "user" data.
// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
// 5. Avoid exposing implementation details on user objects (eg. expando properties)
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
function getData( data ) {
if ( data === "false" ) {
// Only convert to a number if it doesn't change the string
if ( data === +data + "" ) {
if ( rbrace.test( data ) ) {
return JSON.parse( data );
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
// Make sure we set the data so it isn't changed later
dataUser.set( elem, key, data );
hasData: function( elem ) {
return dataUser.hasData( elem ) || dataPriv.hasData( elem );
data: function( elem, name, data ) {
return dataUser.access( elem, name, data );
removeData: function( elem, name ) {
dataUser.remove( elem, name );
// TODO: Now that all calls to _data and _removeData have been replaced
// with direct calls to dataPriv methods, these can be deprecated.
_data: function( elem, name, data ) {
return dataPriv.access( elem, name, data );
_removeData: function( elem, name ) {
dataPriv.remove( elem, name );
data: function( key, value ) {
attrs = elem && elem.attributes;
if ( key === undefined ) {
data = dataUser.get( elem );
if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
// The attrs elements can be null (trac-14894)
if ( name.indexOf( "data-" ) === 0 ) {
name = camelCase( name.slice( 5 ) );
dataAttr( elem, name, data[ name ] );
dataPriv.set( elem, "hasDataAttrs", true );
if ( typeof key === "object" ) {
return this.each( function() {
dataUser.set( this, key );
return access( this, function( value ) {
// The calling jQuery object (element matches) is not empty
// (and therefore has an element appears at this[ 0 ]) and the
// `value` parameter was not undefined. An empty jQuery object
// will result in `undefined` for elem = this[ 0 ] which will
// throw an exception if an attempt to read a data cache is made.
if ( elem && value === undefined ) {
// Attempt to get data from the cache
// The key will always be camelCased in Data
data = dataUser.get( elem, key );
if ( data !== undefined ) {
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
data = dataAttr( elem, key );
if ( data !== undefined ) {
// We tried really hard, but the data doesn't exist.
// We always store the camelCased key
dataUser.set( this, key, value );
}, null, value, arguments.length > 1, null, true );
removeData: function( key ) {
return this.each( function() {
dataUser.remove( this, key );
queue: function( elem, type, data ) {
type = ( type || "fx" ) + "queue";
queue = dataPriv.get( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( !queue || Array.isArray( data ) ) {
queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
dequeue: function( elem, type ) {
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
hooks = jQuery._queueHooks( elem, type ),
jQuery.dequeue( elem, type );
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
queue.unshift( "inprogress" );
// Clear up the last queue stop function
fn.call( elem, next, hooks );
if ( !startLength && hooks ) {
// Not public - generate a queueHooks object, or return the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
empty: jQuery.Callbacks( "once memory" ).add( function() {
dataPriv.remove( elem, [ type + "queue", key ] );
queue: function( type, data ) {
if ( typeof type !== "string" ) {
if ( arguments.length < setter ) {
return jQuery.queue( this[ 0 ], type );
return data === undefined ?
var queue = jQuery.queue( this, type, data );
// Ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
jQuery.dequeue( this, type );
dequeue: function( type ) {
return this.each( function() {
jQuery.dequeue( this, type );
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
defer = jQuery.Deferred(),
defer.resolveWith( elements, [ elements ] );
if ( typeof type !== "string" ) {
tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
tmp.empty.add( resolve );
return defer.promise( obj );
var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
var documentElement = document.documentElement;
var isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem );
composed = { composed: true };
// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
// Check attachment across shadow DOM boundaries when possible (gh-3504)
// Support: iOS 10.0-10.2 only
// Early iOS 10 versions support `attachShadow` but not `getRootNode`,
// leading to errors. We need to check for `getRootNode`.
if ( documentElement.getRootNode ) {
isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem ) ||
elem.getRootNode( composed ) === elem.ownerDocument;
var isHiddenWithinTree = function( elem, el ) {
// isHiddenWithinTree might be called from jQuery#filter function;
// in that case, element will be second argument
// Inline style trumps all
return elem.style.display === "none" ||
elem.style.display === "" &&
// Otherwise, check computed style
// Support: Firefox <=43 - 45
// Disconnected elements can have computed display: none, so first confirm that elem is
jQuery.css( elem, "display" ) === "none";
function adjustCSS( elem, prop, valueParts, tween ) {
return jQuery.css( elem, prop, "" );
initial = currentValue(),
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
// Starting value computation is required for potential unit mismatches
initialInUnit = elem.nodeType &&
( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
rcssNum.exec( jQuery.css( elem, prop ) );
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
// Trust units reported by jQuery.css