Edit File by line
/home/barbar84/www/wp-inclu.../js/jquery
File: jquery.js
function cloneCopyEvent( src, dest ) {
[6000] Fix | Delete
var i, l, type, pdataOld, udataOld, udataCur, events;
[6001] Fix | Delete
[6002] Fix | Delete
if ( dest.nodeType !== 1 ) {
[6003] Fix | Delete
return;
[6004] Fix | Delete
}
[6005] Fix | Delete
[6006] Fix | Delete
// 1. Copy private data: events, handlers, etc.
[6007] Fix | Delete
if ( dataPriv.hasData( src ) ) {
[6008] Fix | Delete
pdataOld = dataPriv.get( src );
[6009] Fix | Delete
events = pdataOld.events;
[6010] Fix | Delete
[6011] Fix | Delete
if ( events ) {
[6012] Fix | Delete
dataPriv.remove( dest, "handle events" );
[6013] Fix | Delete
[6014] Fix | Delete
for ( type in events ) {
[6015] Fix | Delete
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
[6016] Fix | Delete
jQuery.event.add( dest, type, events[ type ][ i ] );
[6017] Fix | Delete
}
[6018] Fix | Delete
}
[6019] Fix | Delete
}
[6020] Fix | Delete
}
[6021] Fix | Delete
[6022] Fix | Delete
// 2. Copy user data
[6023] Fix | Delete
if ( dataUser.hasData( src ) ) {
[6024] Fix | Delete
udataOld = dataUser.access( src );
[6025] Fix | Delete
udataCur = jQuery.extend( {}, udataOld );
[6026] Fix | Delete
[6027] Fix | Delete
dataUser.set( dest, udataCur );
[6028] Fix | Delete
}
[6029] Fix | Delete
}
[6030] Fix | Delete
[6031] Fix | Delete
// Fix IE bugs, see support tests
[6032] Fix | Delete
function fixInput( src, dest ) {
[6033] Fix | Delete
var nodeName = dest.nodeName.toLowerCase();
[6034] Fix | Delete
[6035] Fix | Delete
// Fails to persist the checked state of a cloned checkbox or radio button.
[6036] Fix | Delete
if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
[6037] Fix | Delete
dest.checked = src.checked;
[6038] Fix | Delete
[6039] Fix | Delete
// Fails to return the selected option to the default selected state when cloning options
[6040] Fix | Delete
} else if ( nodeName === "input" || nodeName === "textarea" ) {
[6041] Fix | Delete
dest.defaultValue = src.defaultValue;
[6042] Fix | Delete
}
[6043] Fix | Delete
}
[6044] Fix | Delete
[6045] Fix | Delete
function domManip( collection, args, callback, ignored ) {
[6046] Fix | Delete
[6047] Fix | Delete
// Flatten any nested arrays
[6048] Fix | Delete
args = flat( args );
[6049] Fix | Delete
[6050] Fix | Delete
var fragment, first, scripts, hasScripts, node, doc,
[6051] Fix | Delete
i = 0,
[6052] Fix | Delete
l = collection.length,
[6053] Fix | Delete
iNoClone = l - 1,
[6054] Fix | Delete
value = args[ 0 ],
[6055] Fix | Delete
valueIsFunction = isFunction( value );
[6056] Fix | Delete
[6057] Fix | Delete
// We can't cloneNode fragments that contain checked, in WebKit
[6058] Fix | Delete
if ( valueIsFunction ||
[6059] Fix | Delete
( l > 1 && typeof value === "string" &&
[6060] Fix | Delete
!support.checkClone && rchecked.test( value ) ) ) {
[6061] Fix | Delete
return collection.each( function( index ) {
[6062] Fix | Delete
var self = collection.eq( index );
[6063] Fix | Delete
if ( valueIsFunction ) {
[6064] Fix | Delete
args[ 0 ] = value.call( this, index, self.html() );
[6065] Fix | Delete
}
[6066] Fix | Delete
domManip( self, args, callback, ignored );
[6067] Fix | Delete
} );
[6068] Fix | Delete
}
[6069] Fix | Delete
[6070] Fix | Delete
if ( l ) {
[6071] Fix | Delete
fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
[6072] Fix | Delete
first = fragment.firstChild;
[6073] Fix | Delete
[6074] Fix | Delete
if ( fragment.childNodes.length === 1 ) {
[6075] Fix | Delete
fragment = first;
[6076] Fix | Delete
}
[6077] Fix | Delete
[6078] Fix | Delete
// Require either new content or an interest in ignored elements to invoke the callback
[6079] Fix | Delete
if ( first || ignored ) {
[6080] Fix | Delete
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
[6081] Fix | Delete
hasScripts = scripts.length;
[6082] Fix | Delete
[6083] Fix | Delete
// Use the original fragment for the last item
[6084] Fix | Delete
// instead of the first because it can end up
[6085] Fix | Delete
// being emptied incorrectly in certain situations (#8070).
[6086] Fix | Delete
for ( ; i < l; i++ ) {
[6087] Fix | Delete
node = fragment;
[6088] Fix | Delete
[6089] Fix | Delete
if ( i !== iNoClone ) {
[6090] Fix | Delete
node = jQuery.clone( node, true, true );
[6091] Fix | Delete
[6092] Fix | Delete
// Keep references to cloned scripts for later restoration
[6093] Fix | Delete
if ( hasScripts ) {
[6094] Fix | Delete
[6095] Fix | Delete
// Support: Android <=4.0 only, PhantomJS 1 only
[6096] Fix | Delete
// push.apply(_, arraylike) throws on ancient WebKit
[6097] Fix | Delete
jQuery.merge( scripts, getAll( node, "script" ) );
[6098] Fix | Delete
}
[6099] Fix | Delete
}
[6100] Fix | Delete
[6101] Fix | Delete
callback.call( collection[ i ], node, i );
[6102] Fix | Delete
}
[6103] Fix | Delete
[6104] Fix | Delete
if ( hasScripts ) {
[6105] Fix | Delete
doc = scripts[ scripts.length - 1 ].ownerDocument;
[6106] Fix | Delete
[6107] Fix | Delete
// Reenable scripts
[6108] Fix | Delete
jQuery.map( scripts, restoreScript );
[6109] Fix | Delete
[6110] Fix | Delete
// Evaluate executable scripts on first document insertion
[6111] Fix | Delete
for ( i = 0; i < hasScripts; i++ ) {
[6112] Fix | Delete
node = scripts[ i ];
[6113] Fix | Delete
if ( rscriptType.test( node.type || "" ) &&
[6114] Fix | Delete
!dataPriv.access( node, "globalEval" ) &&
[6115] Fix | Delete
jQuery.contains( doc, node ) ) {
[6116] Fix | Delete
[6117] Fix | Delete
if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
[6118] Fix | Delete
[6119] Fix | Delete
// Optional AJAX dependency, but won't run scripts if not present
[6120] Fix | Delete
if ( jQuery._evalUrl && !node.noModule ) {
[6121] Fix | Delete
jQuery._evalUrl( node.src, {
[6122] Fix | Delete
nonce: node.nonce || node.getAttribute( "nonce" )
[6123] Fix | Delete
}, doc );
[6124] Fix | Delete
}
[6125] Fix | Delete
} else {
[6126] Fix | Delete
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
[6127] Fix | Delete
}
[6128] Fix | Delete
}
[6129] Fix | Delete
}
[6130] Fix | Delete
}
[6131] Fix | Delete
}
[6132] Fix | Delete
}
[6133] Fix | Delete
[6134] Fix | Delete
return collection;
[6135] Fix | Delete
}
[6136] Fix | Delete
[6137] Fix | Delete
function remove( elem, selector, keepData ) {
[6138] Fix | Delete
var node,
[6139] Fix | Delete
nodes = selector ? jQuery.filter( selector, elem ) : elem,
[6140] Fix | Delete
i = 0;
[6141] Fix | Delete
[6142] Fix | Delete
for ( ; ( node = nodes[ i ] ) != null; i++ ) {
[6143] Fix | Delete
if ( !keepData && node.nodeType === 1 ) {
[6144] Fix | Delete
jQuery.cleanData( getAll( node ) );
[6145] Fix | Delete
}
[6146] Fix | Delete
[6147] Fix | Delete
if ( node.parentNode ) {
[6148] Fix | Delete
if ( keepData && isAttached( node ) ) {
[6149] Fix | Delete
setGlobalEval( getAll( node, "script" ) );
[6150] Fix | Delete
}
[6151] Fix | Delete
node.parentNode.removeChild( node );
[6152] Fix | Delete
}
[6153] Fix | Delete
}
[6154] Fix | Delete
[6155] Fix | Delete
return elem;
[6156] Fix | Delete
}
[6157] Fix | Delete
[6158] Fix | Delete
jQuery.extend( {
[6159] Fix | Delete
htmlPrefilter: function( html ) {
[6160] Fix | Delete
return html;
[6161] Fix | Delete
},
[6162] Fix | Delete
[6163] Fix | Delete
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
[6164] Fix | Delete
var i, l, srcElements, destElements,
[6165] Fix | Delete
clone = elem.cloneNode( true ),
[6166] Fix | Delete
inPage = isAttached( elem );
[6167] Fix | Delete
[6168] Fix | Delete
// Fix IE cloning issues
[6169] Fix | Delete
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
[6170] Fix | Delete
!jQuery.isXMLDoc( elem ) ) {
[6171] Fix | Delete
[6172] Fix | Delete
// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
[6173] Fix | Delete
destElements = getAll( clone );
[6174] Fix | Delete
srcElements = getAll( elem );
[6175] Fix | Delete
[6176] Fix | Delete
for ( i = 0, l = srcElements.length; i < l; i++ ) {
[6177] Fix | Delete
fixInput( srcElements[ i ], destElements[ i ] );
[6178] Fix | Delete
}
[6179] Fix | Delete
}
[6180] Fix | Delete
[6181] Fix | Delete
// Copy the events from the original to the clone
[6182] Fix | Delete
if ( dataAndEvents ) {
[6183] Fix | Delete
if ( deepDataAndEvents ) {
[6184] Fix | Delete
srcElements = srcElements || getAll( elem );
[6185] Fix | Delete
destElements = destElements || getAll( clone );
[6186] Fix | Delete
[6187] Fix | Delete
for ( i = 0, l = srcElements.length; i < l; i++ ) {
[6188] Fix | Delete
cloneCopyEvent( srcElements[ i ], destElements[ i ] );
[6189] Fix | Delete
}
[6190] Fix | Delete
} else {
[6191] Fix | Delete
cloneCopyEvent( elem, clone );
[6192] Fix | Delete
}
[6193] Fix | Delete
}
[6194] Fix | Delete
[6195] Fix | Delete
// Preserve script evaluation history
[6196] Fix | Delete
destElements = getAll( clone, "script" );
[6197] Fix | Delete
if ( destElements.length > 0 ) {
[6198] Fix | Delete
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
[6199] Fix | Delete
}
[6200] Fix | Delete
[6201] Fix | Delete
// Return the cloned set
[6202] Fix | Delete
return clone;
[6203] Fix | Delete
},
[6204] Fix | Delete
[6205] Fix | Delete
cleanData: function( elems ) {
[6206] Fix | Delete
var data, elem, type,
[6207] Fix | Delete
special = jQuery.event.special,
[6208] Fix | Delete
i = 0;
[6209] Fix | Delete
[6210] Fix | Delete
for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
[6211] Fix | Delete
if ( acceptData( elem ) ) {
[6212] Fix | Delete
if ( ( data = elem[ dataPriv.expando ] ) ) {
[6213] Fix | Delete
if ( data.events ) {
[6214] Fix | Delete
for ( type in data.events ) {
[6215] Fix | Delete
if ( special[ type ] ) {
[6216] Fix | Delete
jQuery.event.remove( elem, type );
[6217] Fix | Delete
[6218] Fix | Delete
// This is a shortcut to avoid jQuery.event.remove's overhead
[6219] Fix | Delete
} else {
[6220] Fix | Delete
jQuery.removeEvent( elem, type, data.handle );
[6221] Fix | Delete
}
[6222] Fix | Delete
}
[6223] Fix | Delete
}
[6224] Fix | Delete
[6225] Fix | Delete
// Support: Chrome <=35 - 45+
[6226] Fix | Delete
// Assign undefined instead of using delete, see Data#remove
[6227] Fix | Delete
elem[ dataPriv.expando ] = undefined;
[6228] Fix | Delete
}
[6229] Fix | Delete
if ( elem[ dataUser.expando ] ) {
[6230] Fix | Delete
[6231] Fix | Delete
// Support: Chrome <=35 - 45+
[6232] Fix | Delete
// Assign undefined instead of using delete, see Data#remove
[6233] Fix | Delete
elem[ dataUser.expando ] = undefined;
[6234] Fix | Delete
}
[6235] Fix | Delete
}
[6236] Fix | Delete
}
[6237] Fix | Delete
}
[6238] Fix | Delete
} );
[6239] Fix | Delete
[6240] Fix | Delete
jQuery.fn.extend( {
[6241] Fix | Delete
detach: function( selector ) {
[6242] Fix | Delete
return remove( this, selector, true );
[6243] Fix | Delete
},
[6244] Fix | Delete
[6245] Fix | Delete
remove: function( selector ) {
[6246] Fix | Delete
return remove( this, selector );
[6247] Fix | Delete
},
[6248] Fix | Delete
[6249] Fix | Delete
text: function( value ) {
[6250] Fix | Delete
return access( this, function( value ) {
[6251] Fix | Delete
return value === undefined ?
[6252] Fix | Delete
jQuery.text( this ) :
[6253] Fix | Delete
this.empty().each( function() {
[6254] Fix | Delete
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
[6255] Fix | Delete
this.textContent = value;
[6256] Fix | Delete
}
[6257] Fix | Delete
} );
[6258] Fix | Delete
}, null, value, arguments.length );
[6259] Fix | Delete
},
[6260] Fix | Delete
[6261] Fix | Delete
append: function() {
[6262] Fix | Delete
return domManip( this, arguments, function( elem ) {
[6263] Fix | Delete
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
[6264] Fix | Delete
var target = manipulationTarget( this, elem );
[6265] Fix | Delete
target.appendChild( elem );
[6266] Fix | Delete
}
[6267] Fix | Delete
} );
[6268] Fix | Delete
},
[6269] Fix | Delete
[6270] Fix | Delete
prepend: function() {
[6271] Fix | Delete
return domManip( this, arguments, function( elem ) {
[6272] Fix | Delete
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
[6273] Fix | Delete
var target = manipulationTarget( this, elem );
[6274] Fix | Delete
target.insertBefore( elem, target.firstChild );
[6275] Fix | Delete
}
[6276] Fix | Delete
} );
[6277] Fix | Delete
},
[6278] Fix | Delete
[6279] Fix | Delete
before: function() {
[6280] Fix | Delete
return domManip( this, arguments, function( elem ) {
[6281] Fix | Delete
if ( this.parentNode ) {
[6282] Fix | Delete
this.parentNode.insertBefore( elem, this );
[6283] Fix | Delete
}
[6284] Fix | Delete
} );
[6285] Fix | Delete
},
[6286] Fix | Delete
[6287] Fix | Delete
after: function() {
[6288] Fix | Delete
return domManip( this, arguments, function( elem ) {
[6289] Fix | Delete
if ( this.parentNode ) {
[6290] Fix | Delete
this.parentNode.insertBefore( elem, this.nextSibling );
[6291] Fix | Delete
}
[6292] Fix | Delete
} );
[6293] Fix | Delete
},
[6294] Fix | Delete
[6295] Fix | Delete
empty: function() {
[6296] Fix | Delete
var elem,
[6297] Fix | Delete
i = 0;
[6298] Fix | Delete
[6299] Fix | Delete
for ( ; ( elem = this[ i ] ) != null; i++ ) {
[6300] Fix | Delete
if ( elem.nodeType === 1 ) {
[6301] Fix | Delete
[6302] Fix | Delete
// Prevent memory leaks
[6303] Fix | Delete
jQuery.cleanData( getAll( elem, false ) );
[6304] Fix | Delete
[6305] Fix | Delete
// Remove any remaining nodes
[6306] Fix | Delete
elem.textContent = "";
[6307] Fix | Delete
}
[6308] Fix | Delete
}
[6309] Fix | Delete
[6310] Fix | Delete
return this;
[6311] Fix | Delete
},
[6312] Fix | Delete
[6313] Fix | Delete
clone: function( dataAndEvents, deepDataAndEvents ) {
[6314] Fix | Delete
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
[6315] Fix | Delete
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
[6316] Fix | Delete
[6317] Fix | Delete
return this.map( function() {
[6318] Fix | Delete
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
[6319] Fix | Delete
} );
[6320] Fix | Delete
},
[6321] Fix | Delete
[6322] Fix | Delete
html: function( value ) {
[6323] Fix | Delete
return access( this, function( value ) {
[6324] Fix | Delete
var elem = this[ 0 ] || {},
[6325] Fix | Delete
i = 0,
[6326] Fix | Delete
l = this.length;
[6327] Fix | Delete
[6328] Fix | Delete
if ( value === undefined && elem.nodeType === 1 ) {
[6329] Fix | Delete
return elem.innerHTML;
[6330] Fix | Delete
}
[6331] Fix | Delete
[6332] Fix | Delete
// See if we can take a shortcut and just use innerHTML
[6333] Fix | Delete
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
[6334] Fix | Delete
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
[6335] Fix | Delete
[6336] Fix | Delete
value = jQuery.htmlPrefilter( value );
[6337] Fix | Delete
[6338] Fix | Delete
try {
[6339] Fix | Delete
for ( ; i < l; i++ ) {
[6340] Fix | Delete
elem = this[ i ] || {};
[6341] Fix | Delete
[6342] Fix | Delete
// Remove element nodes and prevent memory leaks
[6343] Fix | Delete
if ( elem.nodeType === 1 ) {
[6344] Fix | Delete
jQuery.cleanData( getAll( elem, false ) );
[6345] Fix | Delete
elem.innerHTML = value;
[6346] Fix | Delete
}
[6347] Fix | Delete
}
[6348] Fix | Delete
[6349] Fix | Delete
elem = 0;
[6350] Fix | Delete
[6351] Fix | Delete
// If using innerHTML throws an exception, use the fallback method
[6352] Fix | Delete
} catch ( e ) {}
[6353] Fix | Delete
}
[6354] Fix | Delete
[6355] Fix | Delete
if ( elem ) {
[6356] Fix | Delete
this.empty().append( value );
[6357] Fix | Delete
}
[6358] Fix | Delete
}, null, value, arguments.length );
[6359] Fix | Delete
},
[6360] Fix | Delete
[6361] Fix | Delete
replaceWith: function() {
[6362] Fix | Delete
var ignored = [];
[6363] Fix | Delete
[6364] Fix | Delete
// Make the changes, replacing each non-ignored context element with the new content
[6365] Fix | Delete
return domManip( this, arguments, function( elem ) {
[6366] Fix | Delete
var parent = this.parentNode;
[6367] Fix | Delete
[6368] Fix | Delete
if ( jQuery.inArray( this, ignored ) < 0 ) {
[6369] Fix | Delete
jQuery.cleanData( getAll( this ) );
[6370] Fix | Delete
if ( parent ) {
[6371] Fix | Delete
parent.replaceChild( elem, this );
[6372] Fix | Delete
}
[6373] Fix | Delete
}
[6374] Fix | Delete
[6375] Fix | Delete
// Force callback invocation
[6376] Fix | Delete
}, ignored );
[6377] Fix | Delete
}
[6378] Fix | Delete
} );
[6379] Fix | Delete
[6380] Fix | Delete
jQuery.each( {
[6381] Fix | Delete
appendTo: "append",
[6382] Fix | Delete
prependTo: "prepend",
[6383] Fix | Delete
insertBefore: "before",
[6384] Fix | Delete
insertAfter: "after",
[6385] Fix | Delete
replaceAll: "replaceWith"
[6386] Fix | Delete
}, function( name, original ) {
[6387] Fix | Delete
jQuery.fn[ name ] = function( selector ) {
[6388] Fix | Delete
var elems,
[6389] Fix | Delete
ret = [],
[6390] Fix | Delete
insert = jQuery( selector ),
[6391] Fix | Delete
last = insert.length - 1,
[6392] Fix | Delete
i = 0;
[6393] Fix | Delete
[6394] Fix | Delete
for ( ; i <= last; i++ ) {
[6395] Fix | Delete
elems = i === last ? this : this.clone( true );
[6396] Fix | Delete
jQuery( insert[ i ] )[ original ]( elems );
[6397] Fix | Delete
[6398] Fix | Delete
// Support: Android <=4.0 only, PhantomJS 1 only
[6399] Fix | Delete
// .get() because push.apply(_, arraylike) throws on ancient WebKit
[6400] Fix | Delete
push.apply( ret, elems.get() );
[6401] Fix | Delete
}
[6402] Fix | Delete
[6403] Fix | Delete
return this.pushStack( ret );
[6404] Fix | Delete
};
[6405] Fix | Delete
} );
[6406] Fix | Delete
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
[6407] Fix | Delete
[6408] Fix | Delete
var getStyles = function( elem ) {
[6409] Fix | Delete
[6410] Fix | Delete
// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
[6411] Fix | Delete
// IE throws on elements created in popups
[6412] Fix | Delete
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
[6413] Fix | Delete
var view = elem.ownerDocument.defaultView;
[6414] Fix | Delete
[6415] Fix | Delete
if ( !view || !view.opener ) {
[6416] Fix | Delete
view = window;
[6417] Fix | Delete
}
[6418] Fix | Delete
[6419] Fix | Delete
return view.getComputedStyle( elem );
[6420] Fix | Delete
};
[6421] Fix | Delete
[6422] Fix | Delete
var swap = function( elem, options, callback ) {
[6423] Fix | Delete
var ret, name,
[6424] Fix | Delete
old = {};
[6425] Fix | Delete
[6426] Fix | Delete
// Remember the old values, and insert the new ones
[6427] Fix | Delete
for ( name in options ) {
[6428] Fix | Delete
old[ name ] = elem.style[ name ];
[6429] Fix | Delete
elem.style[ name ] = options[ name ];
[6430] Fix | Delete
}
[6431] Fix | Delete
[6432] Fix | Delete
ret = callback.call( elem );
[6433] Fix | Delete
[6434] Fix | Delete
// Revert the old values
[6435] Fix | Delete
for ( name in options ) {
[6436] Fix | Delete
elem.style[ name ] = old[ name ];
[6437] Fix | Delete
}
[6438] Fix | Delete
[6439] Fix | Delete
return ret;
[6440] Fix | Delete
};
[6441] Fix | Delete
[6442] Fix | Delete
[6443] Fix | Delete
var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
[6444] Fix | Delete
[6445] Fix | Delete
[6446] Fix | Delete
[6447] Fix | Delete
( function() {
[6448] Fix | Delete
[6449] Fix | Delete
// Executing both pixelPosition & boxSizingReliable tests require only one layout
[6450] Fix | Delete
// so they're executed at the same time to save the second computation.
[6451] Fix | Delete
function computeStyleTests() {
[6452] Fix | Delete
[6453] Fix | Delete
// This is a singleton, we need to execute it only once
[6454] Fix | Delete
if ( !div ) {
[6455] Fix | Delete
return;
[6456] Fix | Delete
}
[6457] Fix | Delete
[6458] Fix | Delete
container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
[6459] Fix | Delete
"margin-top:1px;padding:0;border:0";
[6460] Fix | Delete
div.style.cssText =
[6461] Fix | Delete
"position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
[6462] Fix | Delete
"margin:auto;border:1px;padding:1px;" +
[6463] Fix | Delete
"width:60%;top:1%";
[6464] Fix | Delete
documentElement.appendChild( container ).appendChild( div );
[6465] Fix | Delete
[6466] Fix | Delete
var divStyle = window.getComputedStyle( div );
[6467] Fix | Delete
pixelPositionVal = divStyle.top !== "1%";
[6468] Fix | Delete
[6469] Fix | Delete
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
[6470] Fix | Delete
reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
[6471] Fix | Delete
[6472] Fix | Delete
// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
[6473] Fix | Delete
// Some styles come back with percentage values, even though they shouldn't
[6474] Fix | Delete
div.style.right = "60%";
[6475] Fix | Delete
pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
[6476] Fix | Delete
[6477] Fix | Delete
// Support: IE 9 - 11 only
[6478] Fix | Delete
// Detect misreporting of content dimensions for box-sizing:border-box elements
[6479] Fix | Delete
boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
[6480] Fix | Delete
[6481] Fix | Delete
// Support: IE 9 only
[6482] Fix | Delete
// Detect overflow:scroll screwiness (gh-3699)
[6483] Fix | Delete
// Support: Chrome <=64
[6484] Fix | Delete
// Don't get tricked when zoom affects offsetWidth (gh-4029)
[6485] Fix | Delete
div.style.position = "absolute";
[6486] Fix | Delete
scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
[6487] Fix | Delete
[6488] Fix | Delete
documentElement.removeChild( container );
[6489] Fix | Delete
[6490] Fix | Delete
// Nullify the div so it wouldn't be stored in the memory and
[6491] Fix | Delete
// it will also be a sign that checks already performed
[6492] Fix | Delete
div = null;
[6493] Fix | Delete
}
[6494] Fix | Delete
[6495] Fix | Delete
function roundPixelMeasures( measure ) {
[6496] Fix | Delete
return Math.round( parseFloat( measure ) );
[6497] Fix | Delete
}
[6498] Fix | Delete
[6499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function