Make WordPress Core

Ticket #22975: 22975.rc1.patch

File 22975.rc1.patch, 42.5 KB (added by ocean90, 11 years ago)
  • wp-includes/js/jquery/jquery.js

     
    11/*!
    2  * jQuery JavaScript Library v1.9.0b1
     2 * jQuery JavaScript Library v1.9.0rc1
    33 * http://jquery.com/
    44 *
    55 * Includes Sizzle.js
     
    99 * Released under the MIT license
    1010 * http://jquery.org/license
    1111 *
    12  * Date: 2012-12-16
     12 * Date: 2013-1-8
    1313 */
    1414(function( window, undefined ) {
    1515"use strict";
     
    3636        // List of deleted data cache ids, so we can reuse them
    3737        core_deletedIds = [],
    3838
    39         core_version = "1.9.0b1",
     39        core_version = "1.9.0rc1",
    4040
    4141        // Save a reference to some core methods
    4242        core_concat = core_deletedIds.concat,
     
    111111                        return this;
    112112                }
    113113
    114                 // HANDLE: $(DOMElement)
    115                 if ( selector.nodeType ) {
    116                         this.context = this[0] = selector;
    117                         this.length = 1;
    118                         return this;
    119                 }
    120 
    121114                // Handle HTML strings
    122115                if ( typeof selector === "string" ) {
    123116                        if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
     
    191184                                return this.constructor( context ).find( selector );
    192185                        }
    193186
     187                // HANDLE: $(DOMElement)
     188                } else if ( selector.nodeType ) {
     189                        this.context = this[0] = selector;
     190                        this.length = 1;
     191                        return this;
     192
    194193                // HANDLE: $(function)
    195194                // Shortcut for document ready
    196195                } else if ( jQuery.isFunction( selector ) ) {
     
    442441        },
    443442
    444443        type: function( obj ) {
    445                 return obj == null ?
    446                         String( obj ) :
    447                         class2type[ core_toString.call(obj) ] || "object";
     444                if ( obj == null ) {
     445                        return String( obj );
     446                }
     447                return typeof obj === "object" || typeof obj === "function" ?
     448                        class2type[ core_toString.call(obj) ] || "object" :
     449                        typeof obj;
    448450        },
    449451
    450452        isPlainObject: function( obj ) {
     
    509511                        return [ context.createElement( parsed[1] ) ];
    510512                }
    511513
    512                 parsed = context.createDocumentFragment();
    513                 jQuery.clean( [ data ], context, parsed, scripts );
     514                parsed = jQuery.buildFragment( [ data ], context, scripts );
    514515                if ( scripts ) {
    515516                        jQuery( scripts ).remove();
    516517                }
     
    11641165                                        return jQuery.Deferred(function( newDefer ) {
    11651166                                                jQuery.each( tuples, function( i, tuple ) {
    11661167                                                        var action = tuple[ 0 ],
    1167                                                                 fn = fns[ i ];
     1168                                                                fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
    11681169                                                        // deferred[ done | fail | progress ] for forwarding actions to newDefer
    1169                                                         deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
    1170                                                                 function() {
    1171                                                                         var returned = fn.apply( this, arguments );
    1172                                                                         if ( returned && jQuery.isFunction( returned.promise ) ) {
    1173                                                                                 returned.promise()
    1174                                                                                         .done( newDefer.resolve )
    1175                                                                                         .fail( newDefer.reject )
    1176                                                                                         .progress( newDefer.notify );
    1177                                                                         } else {
    1178                                                                                 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, [ returned ] );
    1179                                                                         }
    1180                                                                 } :
    1181                                                                 newDefer[ action ]
    1182                                                         );
     1170                                                        deferred[ tuple[1] ](function() {
     1171                                                                var returned = fn && fn.apply( this, arguments );
     1172                                                                if ( returned && jQuery.isFunction( returned.promise ) ) {
     1173                                                                        returned.promise()
     1174                                                                                .done( newDefer.resolve )
     1175                                                                                .fail( newDefer.reject )
     1176                                                                                .progress( newDefer.notify );
     1177                                                                } else {
     1178                                                                        newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
     1179                                                                }
     1180                                                        });
    11831181                                                });
    11841182                                                fns = null;
    11851183                                        }).promise();
     
    12151213
    12161214                        // deferred[ resolve | reject | notify ]
    12171215                        deferred[ tuple[0] ] = function() {
    1218                                 deferred[ tuple[0] + "With" ]( promise, arguments );
     1216                                deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
    12191217                                return this;
    12201218                        };
    12211219                        deferred[ tuple[0] + "With" ] = list.fireWith;
     
    12871285});
    12881286jQuery.support = (function() {
    12891287
    1290         var support,
    1291                 all,
    1292                 a,
    1293                 select,
    1294                 opt,
    1295                 input,
    1296                 fragment,
    1297                 eventName,
    1298                 i,
    1299                 isSupported,
    1300                 clickFn,
     1288        var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
    13011289                div = document.createElement("div");
    13021290
    13031291        // Setup
     
    13671355                boxModel: document.compatMode === "CSS1Compat",
    13681356
    13691357                // Will be defined later
    1370                 submitBubbles: true,
    1371                 changeBubbles: true,
    1372                 focusinBubbles: false,
    13731358                deleteExpando: true,
    13741359                noCloneEvent: true,
    13751360                inlineBlockNeedsLayout: false,
     
    13881373        select.disabled = true;
    13891374        support.optDisabled = !opt.disabled;
    13901375
    1391         // Test to see if it's possible to delete an expando from an element
    1392         // Fails in Internet Explorer
     1376        // Support: IE<9
    13931377        try {
    13941378                delete div.test;
    13951379        } catch( e ) {
    13961380                support.deleteExpando = false;
    13971381        }
    13981382
    1399         if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
    1400                 div.attachEvent( "onclick", clickFn = function() {
    1401                         // Cloning a node shouldn't copy over any
    1402                         // bound event handlers (IE does this)
    1403                         support.noCloneEvent = false;
    1404                 });
    1405                 div.cloneNode( true ).fireEvent("onclick");
    1406                 div.detachEvent( "onclick", clickFn );
    1407         }
    1408 
    14091383        // Check if we can trust getAttribute("value")
    14101384        input = document.createElement("input");
    14111385        input.setAttribute( "value", "" );
     
    14171391        support.radioValue = input.value === "t";
    14181392
    14191393        // #11217 - WebKit loses check when the name is after the checked attribute
    1420         input.setAttribute( "checked", "checked" );
     1394        input.setAttribute( "checked", "t" );
    14211395        input.setAttribute( "name", "t" );
    14221396
    1423         div.appendChild( input );
    14241397        fragment = document.createDocumentFragment();
    1425         fragment.appendChild( div.lastChild );
     1398        fragment.appendChild( input );
    14261399
    1427         // WebKit doesn't clone checked state correctly in fragments
    1428         support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
    1429 
    14301400        // Check if a disconnected checkbox will retain its checked
    14311401        // value of true after appended to the DOM (IE6/7)
    14321402        support.appendChecked = input.checked;
    14331403
    1434         fragment.removeChild( input );
    1435         fragment.appendChild( div );
     1404        // WebKit doesn't clone checked state correctly in fragments
     1405        support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
    14361406
    1437         // Technique from Juriy Zaytsev
    1438         // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
    1439         // We only care about the case where non-standard event systems
    1440         // are used, namely in IE. Short-circuiting here helps us to
    1441         // avoid an eval call (in setAttribute) which can cause CSP
    1442         // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
     1407        // Support: IE<9
     1408        // Opera does not clone events (and typeof div.attachEvent === undefined).
     1409        // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
    14431410        if ( div.attachEvent ) {
    1444                 for ( i in {
    1445                         submit: true,
    1446                         change: true,
    1447                         focusin: true
    1448                 }) {
    1449                         eventName = "on" + i;
    1450                         isSupported = ( eventName in div );
    1451                         if ( !isSupported ) {
    1452                                 div.setAttribute( eventName, "return;" );
    1453                                 isSupported = ( typeof div[ eventName ] === "function" );
    1454                         }
    1455                         support[ i + "Bubbles" ] = isSupported;
    1456                 }
     1411                div.attachEvent( "onclick", function() {
     1412                        support.noCloneEvent = false;
     1413                });
     1414
     1415                div.cloneNode( true ).click();
    14571416        }
    14581417
     1418        // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
     1419        // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
     1420        for ( i in { submit: true, change: true, focusin: true }) {
     1421                div.setAttribute( eventName = "on" + i, "t" );
     1422
     1423                support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
     1424        }
     1425
     1426        div.style.backgroundClip = "content-box";
     1427        div.cloneNode( true ).style.backgroundClip = "";
     1428        support.clearCloneStyle = div.style.backgroundClip === "content-box";
     1429
    14591430        // Run tests that need a body at doc ready
    14601431        jQuery(function() {
    1461                 var container, div, tds, marginDiv,
    1462                         divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
     1432                var container, marginDiv, tds,
     1433                        divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
    14631434                        body = document.getElementsByTagName("body")[0];
    14641435
    14651436                if ( !body ) {
     
    14681439                }
    14691440
    14701441                container = document.createElement("div");
    1471                 container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
    1472                 body.insertBefore( container, body.firstChild );
     1442                container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
    14731443
    1474                 // Construct the test element
    1475                 div = document.createElement("div");
    1476                 container.appendChild( div );
     1444                body.appendChild( container ).appendChild( div );
    14771445
     1446                // Support: IE8
    14781447                // Check if table cells still have offsetWidth/Height when they are set
    14791448                // to display:none and there are still other visible table cells in a
    14801449                // table row; if so, offsetWidth/Height are not reliable for use when
    14811450                // determining if an element has been hidden directly using
    14821451                // display:none (it is still safe to use offsets if a parent element is
    14831452                // hidden; don safety goggles and see bug #4512 for more information).
    1484                 // (only IE 8 fails this test)
    14851453                div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
    14861454                tds = div.getElementsByTagName("td");
    14871455                tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
     
    14901458                tds[ 0 ].style.display = "";
    14911459                tds[ 1 ].style.display = "none";
    14921460
     1461                // Support: IE8
    14931462                // Check if empty table cells still have offsetWidth/Height
    1494                 // (IE <= 8 fail this test)
    14951463                support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
    14961464
    14971465                // Check box-sizing and margin behavior
     
    15001468                support.boxSizing = ( div.offsetWidth === 4 );
    15011469                support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
    15021470
    1503                 // NOTE: To any future maintainer, we've window.getComputedStyle
    1504                 // because jsdom on node.js will break without it.
     1471                // Use window.getComputedStyle because jsdom on node.js will break without it.
    15051472                if ( window.getComputedStyle ) {
    15061473                        support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
    15071474                        support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
    15081475
    15091476                        // Check if div with explicit width and no margin-right incorrectly
    1510                         // gets computed margin-right based on width of container. For more
    1511                         // info see bug #3333
     1477                        // gets computed margin-right based on width of container. (#3333)
    15121478                        // Fails in WebKit before Feb 2011 nightlies
    15131479                        // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
    1514                         marginDiv = document.createElement("div");
     1480                        marginDiv = div.appendChild( document.createElement("div") );
    15151481                        marginDiv.style.cssText = div.style.cssText = divReset;
    15161482                        marginDiv.style.marginRight = marginDiv.style.width = "0";
    15171483                        div.style.width = "1px";
    1518                         div.appendChild( marginDiv );
     1484
    15191485                        support.reliableMarginRight =
    15201486                                !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
    15211487                }
    15221488
    15231489                if ( typeof div.style.zoom !== "undefined" ) {
     1490                        // Support: IE<8
    15241491                        // Check if natively block-level elements act like inline-block
    15251492                        // elements when setting their display to 'inline' and giving
    15261493                        // them layout
    1527                         // (IE < 8 does this)
    15281494                        div.innerHTML = "";
    15291495                        div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
    15301496                        support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
    15311497
     1498                        // Support: IE6
    15321499                        // Check if elements with layout shrink-wrap their children
    1533                         // (IE 6 does this)
    15341500                        div.style.display = "block";
    1535                         div.style.overflow = "visible";
    15361501                        div.innerHTML = "<div></div>";
    15371502                        div.firstChild.style.width = "5px";
    15381503                        support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
     
    15421507                        body.style.zoom = 1;
    15431508                }
    15441509
     1510                body.removeChild( container );
     1511
    15451512                // Null elements to avoid leaks in IE
    1546                 body.removeChild( container );
    15471513                container = div = tds = marginDiv = null;
    15481514        });
    15491515
    15501516        // Null elements to avoid leaks in IE
    1551         fragment.removeChild( div );
    1552         all = a = select = opt = input = fragment = div = null;
     1517        all = select = fragment = opt = a = input = null;
    15531518
    15541519        return support;
    15551520})();
     1521
    15561522var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
    15571523        rmultiDash = /([A-Z])/g;
    15581524
     
    19261892                        startLength--;
    19271893                }
    19281894
     1895                hooks.cur = fn;
    19291896                if ( fn ) {
    19301897
    19311898                        // Add a progress sentinel to prevent the fx queue from being
     
    23672334
    23682335                } else {
    23692336
    2370                         ret = elem.getAttribute( name );
     2337                        // In IE9+, Flash objects don't have .getAttribute (#12945)
     2338                        // Support: IE9+
     2339                        if ( typeof elem.getAttribute !== "undefined" ) {
     2340                                ret =  elem.getAttribute( name );
     2341                        }
    23712342
    23722343                        // Non-existent attributes return null, we normalize to undefined
    23732344                        return ret == null ?
     
    26372608        jQuery.attrHooks.style = {
    26382609                get: function( elem ) {
    26392610                        // Return undefined in the case of empty string
    2640                         // Normalize to lowercase since IE uppercases css property names
    2641                         return elem.style.cssText.toLowerCase() || undefined;
     2611                        // Note: IE uppercases css property names, but if we were to .toLowerCase()
     2612                        // .cssText, that would destroy case senstitivity in URL's, like in "background"
     2613                        return elem.style.cssText || undefined;
    26422614                },
    26432615                set: function( elem, value ) {
    26442616                        return ( elem.style.cssText = value + "" );
     
    36333605                return this.off( types, null, fn );
    36343606        },
    36353607
    3636         live: function( types, data, fn ) {
    3637                 jQuery( this.context ).on( types, this.selector, data, fn );
    3638                 return this;
    3639         },
    3640         die: function( types, fn ) {
    3641                 jQuery( this.context ).off( types, this.selector || "**", fn );
    3642                 return this;
    3643         },
    3644 
    36453608        delegate: function( selector, types, data, fn ) {
    36463609                return this.on( types, selector, data, fn );
    36473610        },
     
    37133676        contains,
    37143677        sortOrder,
    37153678
     3679        // Instance-specific data
    37163680        expando = "sizzle" + -(new Date()),
     3681        preferredDoc = window.document,
     3682        support = {},
     3683        dirruns = 0,
     3684        done = 0,
     3685        classCache = createCache(),
     3686        tokenCache = createCache(),
     3687        compilerCache = createCache(),
    37173688
     3689        // General-purpose constants
     3690        Token = String,
    37183691        strundefined = typeof undefined,
    3719 
    3720         // Used in sorting
    37213692        MAX_NEGATIVE = 1 << 31,
    3722         preferredDoc = window.document,
    37233693
    3724         Token = String,
    3725         dirruns = 0,
    3726         done = 0,
    3727         support = {},
    3728 
    37293694        // Array methods
    37303695        arr = [],
    37313696        pop = arr.pop,
     
    37433708                return -1;
    37443709        },
    37453710
    3746         // Augment a function for special use by Sizzle
    3747         markFunction = function( fn, value ) {
    3748                 fn[ expando ] = value == null || value;
    3749                 return fn;
    3750         },
    37513711
    3752         createCache = function() {
    3753                 var cache = {},
    3754                         keys = [];
     3712        // Regular expressions
    37553713
    3756                 return markFunction(function( key, value ) {
    3757                         // Only keep the most recent entries
    3758                         if ( keys.push( key ) > Expr.cacheLength ) {
    3759                                 delete cache[ keys.shift() ];
    3760                         }
    3761 
    3762                         // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
    3763                         return (cache[ key + " " ] = value);
    3764                 }, cache );
    3765         },
    3766 
    3767         classCache = createCache(),
    3768         tokenCache = createCache(),
    3769         compilerCache = createCache(),
    3770 
    3771         // Regex
    3772 
    37733714        // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
    37743715        whitespace = "[\\x20\\t\\r\\n\\f]",
    37753716        // http://www.w3.org/TR/css3-syntax/#characters
    37763717        characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
    37773718
    37783719        // Loosely modeled on CSS identifier characters
    3779         // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
     3720        // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
    37803721        // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
    37813722        identifier = characterEncoding.replace( "w", "w#" ),
    37823723
     
    37993740        rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
    38003741        rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
    38013742        rpseudo = new RegExp( pseudos ),
     3743        ridentifier = new RegExp( "^" + identifier + "$" ),
    38023744
    3803         // Easily-parseable/retrievable ID or TAG or CLASS selectors
    3804         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
    3805 
    3806         rsibling = /[\x20\t\r\n\f]*[+~]/,
    3807 
    3808         rheader = /h\d/i,
    3809         rinputs = /input|select|textarea|button/i,
    3810 
    3811         rnative = /\{\s*\[native code\]\s*\}/,
    3812 
    3813         rbackslash = /\\(?!\\)/g,
    3814 
    3815         rescape = /'|\\/g,
    3816         rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
    3817 
    38183745        matchExpr = {
    38193746                "ID": new RegExp( "^#(" + characterEncoding + ")" ),
    38203747                "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
     
    38313758                        whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
    38323759        },
    38333760
    3834         /**
    3835          * For feature detection
    3836          * @param {Function} fn The function to test for native support
    3837          */
    3838         isNative = function( fn ) {
    3839                 return rnative.test( fn + "" );
    3840         },
     3761        rsibling = /[\x20\t\r\n\f]*[+~]/,
    38413762
    3842         /**
    3843          * Support testing using an element
    3844          * @param {Function} fn Passed the created div and expects a boolean result
    3845          */
    3846         assert = function( fn ) {
    3847                 var div = document.createElement("div");
     3763        rnative = /\{\s*\[native code\]\s*\}/,
    38483764
    3849                 try {
    3850                         return fn( div );
    3851                 } catch (e) {
    3852                         return false;
    3853                 } finally {
    3854                         // release memory in IE
    3855                         div = null;
    3856                 }
     3765        // Easily-parseable/retrievable ID or TAG or CLASS selectors
     3766        rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
     3767
     3768        rinputs = /^(?:input|select|textarea|button)$/i,
     3769        rheader = /^h\d$/i,
     3770
     3771        rescape = /'|\\/g,
     3772        rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
     3773
     3774        // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
     3775        runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
     3776        funescape = function( _, escaped ) {
     3777                var high = "0x" + escaped - 0x10000;
     3778                // NaN means non-codepoint
     3779                return high !== high ?
     3780                        escaped :
     3781                        // BMP codepoint
     3782                        high < 0 ?
     3783                                String.fromCharCode( high + 0x10000 ) :
     3784                                // Supplemental Plane codepoint (surrogate pair)
     3785                                String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
    38573786        };
    38583787
    38593788// Use a stripped-down slice if we can't use a native one
     
    38703799        };
    38713800}
    38723801
     3802/**
     3803 * For feature detection
     3804 * @param {Function} fn The function to test for native support
     3805 */
     3806function isNative( fn ) {
     3807        return rnative.test( fn + "" );
     3808}
     3809
     3810/**
     3811 * Create key-value caches of limited size
     3812 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
     3813 *      property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
     3814 *      deleting the oldest entry
     3815 */
     3816function createCache() {
     3817        var cache,
     3818                keys = [];
     3819
     3820        return (cache = function( key, value ) {
     3821                // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
     3822                if ( keys.push( key += " " ) > Expr.cacheLength ) {
     3823                        // Only keep the most recent entries
     3824                        delete cache[ keys.shift() ];
     3825                }
     3826                return (cache[ key ] = value);
     3827        });
     3828}
     3829
     3830/**
     3831 * Mark a function for special use by Sizzle
     3832 * @param {Function} fn The function to mark
     3833 */
     3834function markFunction( fn ) {
     3835        fn[ expando ] = true;
     3836        return fn;
     3837}
     3838
     3839/**
     3840 * Support testing using an element
     3841 * @param {Function} fn Passed the created div and expects a boolean result
     3842 */
     3843function assert( fn ) {
     3844        var div = document.createElement("div");
     3845
     3846        try {
     3847                return fn( div );
     3848        } catch (e) {
     3849                return false;
     3850        } finally {
     3851                // release memory in IE
     3852                div = null;
     3853        }
     3854}
     3855
    38733856function Sizzle( selector, context, results, seed ) {
    38743857        var match, elem, m, nodeType,
    38753858                // QSA vars
    38763859                i, groups, old, nid, newContext, newSelector;
    38773860
    3878         if ( context && (( context.ownerDocument || context ) !== document) ) {
     3861        if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
    38793862                setDocument( context );
    38803863        }
    38813864
     
    39963979 * @param {Element|Object} [doc] An element or document object to use to set the document
    39973980 * @returns {Object} Returns the current document
    39983981 */
    3999 setDocument = Sizzle.setDocument = function( doc ) {
    4000         doc = doc && doc.ownerDocument || doc || window.document;
     3982setDocument = Sizzle.setDocument = function( node ) {
     3983        var doc = node ? node.ownerDocument || node : preferredDoc;
    40013984
    40023985        // If no document and documentElement is available, return
    4003         if ( !doc || doc.nodeType !== 9 || !doc.documentElement || document === doc ) {
     3986        if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
    40043987                return document;
    40053988        }
    40063989
     
    40874070                        }
    40884071                };
    40894072                Expr.filter["ID"] = function( id ) {
    4090                         var attrId = id.replace( rbackslash, "" );
     4073                        var attrId = id.replace( runescape, funescape );
    40914074                        return function( elem ) {
    40924075                                return elem.getAttribute("id") === attrId;
    40934076                        };
     
    41054088                        }
    41064089                };
    41074090                Expr.filter["ID"] =  function( id ) {
    4108                         var attrId = id.replace( rbackslash, "" );
     4091                        var attrId = id.replace( runescape, funescape );
    41094092                        return function( elem ) {
    41104093                                var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
    41114094                                return node && node.value === attrId;
     
    41894172
    41904173                assert(function( div ) {
    41914174
    4192                         // Opera 10-12/IE9 - ^= $= *= and empty values
     4175                        // Opera 10-12/IE8 - ^= $= *= and empty values
    41934176                        // Should not select anything
    4194                         div.innerHTML = "<p test=''></p>";
    4195                         if ( div.querySelectorAll("[test^='']").length ) {
     4177                        div.innerHTML = "<input type='hidden' i=''/>";
     4178                        if ( div.querySelectorAll("[i^='']").length ) {
    41964179                                rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
    41974180                        }
    41984181
    41994182                        // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
    42004183                        // IE8 throws error here and will not see later tests
    4201                         div.innerHTML = "<input type='hidden'/>";
    42024184                        if ( !div.querySelectorAll(":enabled").length ) {
    42034185                                rbuggyQSA.push( ":enabled", ":disabled" );
    42044186                        }
     
    42224204
    42234205                        // This should fail with an exception
    42244206                        // Gecko does not error, returns false instead
    4225                         matches.call( div, "[test!='']:x" );
     4207                        matches.call( div, "[s!='']:x" );
    42264208                        rbuggyMatches.push( "!=", pseudos );
    42274209                });
    42284210        }
     
    43444326};
    43454327
    43464328Sizzle.matches = function( expr, elements ) {
    4347         return Sizzle( expr, window.document, null, elements );
     4329        return Sizzle( expr, null, null, elements );
    43484330};
    43494331
    43504332Sizzle.matchesSelector = function( elem, expr ) {
    43514333        // Set document vars if needed
    4352         if ( elem && (( elem.ownerDocument || elem ) !== document) ) {
     4334        if ( ( elem.ownerDocument || elem ) !== document ) {
    43534335                setDocument( elem );
    43544336        }
    43554337
     
    43764358
    43774359Sizzle.contains = function( context, elem ) {
    43784360        // Set document vars if needed
    4379         if ( context && (( context.ownerDocument || context ) !== document) ) {
     4361        if ( ( context.ownerDocument || context ) !== document ) {
    43804362                setDocument( context );
    43814363        }
    43824364        return contains( context, elem );
     
    43864368        var val;
    43874369
    43884370        // Set document vars if needed
    4389         if ( elem && (( elem.ownerDocument || elem ) !== document) ) {
     4371        if ( ( elem.ownerDocument || elem ) !== document ) {
    43904372                setDocument( elem );
    43914373        }
    43924374
     
    45354517
    45364518        preFilter: {
    45374519                "ATTR": function( match ) {
    4538                         match[1] = match[1].replace( rbackslash, "" );
     4520                        match[1] = match[1].replace( runescape, funescape );
    45394521
    45404522                        // Move the given value to match[3] whether quoted or unquoted
    4541                         match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
     4523                        match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
    45424524
    45434525                        if ( match[2] === "~=" ) {
    45444526                                match[3] = " " + match[3] + " ";
     
    46154597                                return function() { return true; };
    46164598                        }
    46174599
    4618                         nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
     4600                        nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
    46194601                        return function( elem ) {
    46204602                                return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
    46214603                        };
    46224604                },
    46234605
    46244606                "CLASS": function( className ) {
    4625                         var pattern = classCache[ expando ][ className + " " ];
     4607                        var pattern = classCache[ className + " " ];
    46264608
    46274609                        return pattern ||
    46284610                                (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
     
    48244806                        };
    48254807                }),
    48264808
     4809                // "Whether an element is represented by a :lang() selector
     4810                // is based solely on the element's language value
     4811                // being equal to the identifier C,
     4812                // or beginning with the identifier C immediately followed by "-".
     4813                // The matching of C against the element's language value is performed case-insensitively.
     4814                // The identifier C does not have to be a valid language name."
     4815                // http://www.w3.org/TR/selectors/#lang-pseudo
     4816                "lang": markFunction( function( lang ) {
     4817                        // lang value must be a valid identifider
     4818                        if ( !ridentifier.test(lang || "") ) {
     4819                                Sizzle.error( "unsupported lang: " + lang );
     4820                        }
     4821                        lang = lang.replace( runescape, funescape ).toLowerCase();
     4822                        return function( elem ) {
     4823                                var elemLang;
     4824                                do {
     4825                                        if ( (elemLang = documentIsXML ?
     4826                                                elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
     4827                                                elem.lang) ) {
     4828
     4829                                                elemLang = elemLang.toLowerCase();
     4830                                                return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
     4831                                        }
     4832                                } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
     4833                                return false;
     4834                        };
     4835                }),
     4836
    48274837                // Miscellaneous
    48284838                "target": function( elem ) {
    48294839                        var hash = window.location && window.location.hash;
     
    49644974function tokenize( selector, parseOnly ) {
    49654975        var matched, match, tokens, type,
    49664976                soFar, groups, preFilters,
    4967                 cached = tokenCache[ expando ][ selector + " " ];
     4977                cached = tokenCache[ selector + " " ];
    49684978
    49694979        if ( cached ) {
    49704980                return parseOnly ? 0 : cached.slice( 0 );
     
    53575367        var i,
    53585368                setMatchers = [],
    53595369                elementMatchers = [],
    5360                 cached = compilerCache[ expando ][ selector + " " ];
     5370                cached = compilerCache[ selector + " " ];
    53615371
    53625372        if ( !cached ) {
    53635373                // Generate a function of recursive functions that can be used to check each element
     
    54035413                                        context.nodeType === 9 && !documentIsXML &&
    54045414                                        Expr.relative[ tokens[1].type ] ) {
    54055415
    5406                                 context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context )[0];
     5416                                context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
    54075417                                if ( !context ) {
    54085418                                        return results;
    54095419                                }
     
    54225432                                if ( (find = Expr.find[ type ]) ) {
    54235433                                        // Search, expanding context for leading sibling combinators
    54245434                                        if ( (seed = find(
    5425                                                 token.matches[0].replace( rbackslash, "" ),
     5435                                                token.matches[0].replace( runescape, funescape ),
    54265436                                                rsibling.test( tokens[0].type ) && context.parentNode || context
    54275437                                        )) ) {
    54285438
     
    59445954                        while ( elem.firstChild ) {
    59455955                                elem.removeChild( elem.firstChild );
    59465956                        }
     5957
     5958                        // If this is a select, ensure that it displays empty (#12336)
     5959                        // Support: IE<9
     5960                        if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
     5961                                elem.options.length = 0;
     5962                        }
    59475963                }
    59485964
    59495965                return this;
     
    60386054                var fragment, first, scripts, hasScripts, node, doc,
    60396055                        i = 0,
    60406056                        l = this.length,
     6057                        set = this,
    60416058                        iNoClone = l - 1,
    60426059                        value = args[0],
    60436060                        isFunction = jQuery.isFunction( value );
    60446061
    60456062                // We can't cloneNode fragments that contain checked, in WebKit
    60466063                if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
    6047                         return this.each(function() {
    6048                                 var self = jQuery( this );
     6064                        return this.each(function( index ) {
     6065                                var self = set.eq( index );
    60496066                                if ( isFunction ) {
    6050                                         args[0] = value.call( this, i, table ? self.html() : undefined );
     6067                                        args[0] = value.call( this, index, table ? self.html() : undefined );
    60516068                                }
    60526069                                self.domManip( args, table, callback );
    60536070                        });
     
    60556072
    60566073                if ( this[0] ) {
    60576074                        doc = this[0].ownerDocument;
    6058                         fragment = doc.createDocumentFragment();
    6059                         jQuery.clean( args, doc, fragment, undefined, this );
     6075                        fragment = jQuery.buildFragment( args, doc, false, this );
    60606076                        first = fragment.firstChild;
    60616077
    60626078                        if ( fragment.childNodes.length === 1 ) {
     
    63016317                found;
    63026318}
    63036319
    6304 // Used in clean, fixes the defaultChecked property
     6320// Used in buildFragment, fixes the defaultChecked property
    63056321function fixDefaultChecked( elem ) {
    63066322        if ( manipulation_rcheckableType.test( elem.type ) ) {
    63076323                elem.defaultChecked = elem.checked;
     
    63646380                return clone;
    63656381        },
    63666382
    6367         clean: function( elems, context, fragment, scripts, selection ) {
     6383        buildFragment: function( elems, context, scripts, selection ) {
    63686384                var elem, i, j, tmp, tag, wrap, tbody,
    63696385                        ret = [],
     6386                        fragment = context.createDocumentFragment(),
    63706387                        safe = context === document && safeFragment;
    63716388
    63726389                // Ensure that context is a document
     
    64536470                        jQuery.grep( getAll( ret, "input" ), fixDefaultChecked );
    64546471                }
    64556472
    6456                 if ( fragment ) {
    6457                         for ( i = 0; (elem = ret[i]) != null; i++ ) {
    6458                                 safe = jQuery.contains( elem.ownerDocument, elem );
     6473                for ( i = 0; (elem = ret[i]) != null; i++ ) {
     6474                        safe = jQuery.contains( elem.ownerDocument, elem );
    64596475
    6460                                 // Append to fragment
    6461                                 // #4087 - If origin and destination elements are the same, and this is
    6462                                 // that element, do not append to fragment
    6463                                 if ( !selection || jQuery.inArray( elem, selection ) === -1 ) {
    6464                                         fragment.appendChild( elem );
    6465                                 }
    6466                                 tmp = getAll( elem, "script" );
     6476                        // Append to fragment
     6477                        // #4087 - If origin and destination elements are the same, and this is
     6478                        // that element, do not append to fragment
     6479                        if ( !selection || jQuery.inArray( elem, selection ) === -1 ) {
     6480                                fragment.appendChild( elem );
     6481                        }
     6482                        tmp = getAll( elem, "script" );
    64676483
    6468                                 // Preserve script evaluation history
    6469                                 if ( safe ) {
    6470                                         setGlobalEval( tmp );
    6471                                 }
     6484                        // Preserve script evaluation history
     6485                        if ( safe ) {
     6486                                setGlobalEval( tmp );
     6487                        }
    64726488
    6473                                 // Capture executables
    6474                                 if ( scripts ) {
    6475                                         for ( j = 0; (elem = tmp[j]) != null; j++ ) {
    6476                                                 if ( rscriptType.test( elem.type || "" ) ) {
    6477                                                         scripts.push( elem );
    6478                                                 }
     6489                        // Capture executables
     6490                        if ( scripts ) {
     6491                                for ( j = 0; (elem = tmp[j]) != null; j++ ) {
     6492                                        if ( rscriptType.test( elem.type || "" ) ) {
     6493                                                scripts.push( elem );
    64796494                                        }
    64806495                                }
    64816496                        }
     
    64836498
    64846499                elem = tmp = safe = null;
    64856500
    6486                 return ret;
     6501                return fragment;
    64876502        },
    64886503
    64896504        cleanData: function( elems, /* internal */ acceptData ) {
     
    65256540                                                if ( deleteExpando ) {
    65266541                                                        delete elem[ internalKey ];
    65276542
    6528                                                 } else if ( elem.removeAttribute ) {
     6543                                                } else if ( typeof elem.removeAttribute !== "undefined" ) {
    65296544                                                        elem.removeAttribute( internalKey );
    65306545
    65316546                                                } else {
     
    67546769
    67556770                        // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
    67566771                        // but it would mean to define eight (for every problematic property) identical functions
    6757                         if ( value === "" && name.indexOf("background") === 0 ) {
    6758                                 value = " ";
     6772                        if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
     6773                                style[ name ] = "inherit";
    67596774                        }
    67606775
    67616776                        // If a hook was provided, use that value, otherwise just set the specified value
     
    86098624
    86108625function Animation( elem, properties, options ) {
    86118626        var result,
     8627                stopped,
    86128628                index = 0,
    86138629                length = animationPrefilters.length,
    86148630                deferred = jQuery.Deferred().always( function() {
     
    86168632                        delete tick.elem;
    86178633                }),
    86188634                tick = function() {
     8635                        if ( stopped ) {
     8636                                return false;
     8637                        }
    86198638                        var currentTime = fxNow || createFxNow(),
    86208639                                remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
    86218640                                // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
     
    86578676                                        // if we are going to the end, we want to run all the tweens
    86588677                                        // otherwise we skip this part
    86598678                                        length = gotoEnd ? animation.tweens.length : 0;
    8660 
     8679                                if ( stopped ) {
     8680                                        return this;
     8681                                }
     8682                                stopped = true;
    86618683                                for ( ; index < length ; index++ ) {
    86628684                                        animation.tweens[ index ].run( 1 );
    86638685                                }
     
    90149036                        doAnimation = function() {
    90159037                                // Operate on a copy of prop so per-property easing won't be lost
    90169038                                var anim = Animation( this, jQuery.extend( {}, prop ), optall );
    9017 
    9018                                 // Empty animations resolve immediately
    9019                                 if ( empty ) {
     9039                                doAnimation.finish = function() {
    90209040                                        anim.stop( true );
     9041                                };
     9042                                // Empty animations, or finishing resolves immediately
     9043                                if ( empty || jQuery._data( this, "finish" ) ) {
     9044                                        anim.stop( true );
    90219045                                }
    90229046                        };
     9047                        doAnimation.finish = doAnimation;
    90239048
    90249049                return empty || optall.queue === false ?
    90259050                        this.each( doAnimation ) :
     
    90749099                                jQuery.dequeue( this, type );
    90759100                        }
    90769101                });
     9102        },
     9103        finish: function( type ) {
     9104                if ( type !== false ) {
     9105                        type = type || "fx";
     9106                }
     9107                return this.each(function() {
     9108                        var index,
     9109                                data = jQuery._data( this ),
     9110                                queue = data[ type + "queue" ],
     9111                                hooks = data[ type + "queueHooks" ],
     9112                                timers = jQuery.timers,
     9113                                length = queue ? queue.length : 0;
     9114
     9115                        // enable finishing flag on private data
     9116                        data.finish = true;
     9117
     9118                        // empty the queue first
     9119                        jQuery.queue( this, type, [] );
     9120
     9121                        if ( hooks && hooks.cur && hooks.cur.finish ) {
     9122                                hooks.cur.finish.call( this );
     9123                        }
     9124
     9125                        // look for any active animations, and finish them
     9126                        for ( index = timers.length; index--; ) {
     9127                                if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
     9128                                        timers[ index ].anim.stop( true );
     9129                                        timers.splice( index, 1 );
     9130                                }
     9131                        }
     9132
     9133                        // look for any animations in the old queue and finish them
     9134                        for ( index = 0; index < length; index++ ) {
     9135                                if ( queue[ index ] && queue[ index ].finish ) {
     9136                                        queue[ index ].finish.call( this );
     9137                                }
     9138                        }
     9139
     9140                        // turn off finishing flag
     9141                        delete data.finish;
     9142                });
    90779143        }
    90789144});
    90799145
  • wp-includes/js/jquery/jquery-migrate.js

     
    11/*!
    2  * jQuery Migrate - v1.0.0pre - 2012-12-17
     2 * jQuery Migrate - v1.0.0pre - 2013-01-09
    33 * https://github.com/jquery/jquery-migrate
    4  * Copyright 2012 jQuery Foundation and other contributors; Licensed MIT
     4 * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT
    55 */
    6 
    76(function( jQuery, window, undefined ) {
    87"use strict";
    98
    109// Use Uglify to do conditional compilation of warning messages;
    11 // the minified version will set this to false and remove dead code.
    12 if ( typeof window.JQMIGRATE_WARN === "undefined" ) {
    13         window.JQMIGRATE_WARN = true;
    14 }
     10// the minified version will set this to false during compilation.
     11window.JQMIGRATE_WARN = typeof JQMIGRATE_WARN === "undefined";
    1512
    1613
    1714var warnedAbout = {};
     
    1916// List of warnings already given; public read only
    2017jQuery.migrateWarnings = [];
    2118
     19// Set to true to prevent console output; migrateWarnings still maintained
     20// Leave as undefined so that it can be set before plugin is loaded
     21//jQuery.migrateMute = false;
     22
    2223// Forget any warnings we've already given; public
    2324jQuery.migrateReset = function() {
    2425        warnedAbout = {};
     
    3031                if ( !warnedAbout[ msg ] ) {
    3132                        warnedAbout[ msg ] = true;
    3233                        jQuery.migrateWarnings.push( msg );
    33                         if ( window.console && console.warn ) {
     34                        if ( window.console && console.warn && !jQuery.migrateMute ) {
    3435                                console.warn( "JQMIGRATE: " + msg );
    3536                        }
    3637                }
     
    7879        valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
    7980                function() { return undefined; },
    8081        rnoType = /^(?:input|button)$/i,
    81         rnoAttrNodeType = /^[238]$/;
     82        rnoAttrNodeType = /^[238]$/,
     83        rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
     84        ruseDefault = /^(?:checked|selected)$/i;
    8285
    8386// jQuery.attrFn
    8487migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
    8588
    8689jQuery.attr = function( elem, name, value, pass ) {
     90        var lowerName = name.toLowerCase(),
     91                nType = elem && elem.nodeType;
     92
    8793        if ( pass ) {
    8894                migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
    89                 if ( elem && !rnoAttrNodeType.test( elem.nodeType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
     95                if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
    9096                        return jQuery( elem )[ name ]( value );
    9197                }
    9298        }
     
    96102                migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
    97103        }
    98104
     105        // Restore boolHook for boolean property/attribute synchronization
     106        if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
     107                jQuery.attrHooks[ lowerName ] = {
     108                        get: function( elem, name ) {
     109                                // Align boolean attributes with corresponding properties
     110                                // Fall back to attribute presence where some booleans are not supported
     111                                var attrNode,
     112                                        property = jQuery.prop( elem, name );
     113                                return property === true || typeof property !== "boolean" &&
     114                                        ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
     115
     116                                        name.toLowerCase() :
     117                                        undefined;
     118                        },
     119                        set: function( elem, value, name ) {
     120                                var propName;
     121                                if ( value === false ) {
     122                                        // Remove boolean attributes when set to false
     123                                        jQuery.removeAttr( elem, name );
     124                                } else {
     125                                        // value is true since we know at this point it's type boolean and not false
     126                                        // Set boolean attributes to the same name and set the DOM property
     127                                        propName = jQuery.propFix[ name ] || name;
     128                                        if ( propName in elem ) {
     129                                                // Only set the IDL specifically if it already exists on the element
     130                                                elem[ propName ] = true;
     131                                        }
     132
     133                                        elem.setAttribute( name, name.toLowerCase() );
     134                                }
     135                                return name;
     136                        }
     137                };
     138
     139                // Warn only for attributes that can remain distinct from their properties post-1.9
     140                if ( ruseDefault.test( lowerName ) ) {
     141                        migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" );
     142                }
     143        }
     144
    99145        return attr.call( jQuery, elem, name, value );
    100146};
    101147
    102148// attrHooks: value
    103149jQuery.attrHooks.value = {
    104150        get: function( elem, name ) {
    105                 if ( jQuery.nodeName( elem, "button" ) ) {
     151                var nodeName = ( elem.nodeName || "" ).toLowerCase();
     152                if ( nodeName === "button" ) {
    106153                        return valueAttrGet.apply( this, arguments );
    107154                }
    108                 migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
     155                if ( nodeName !== "input" && nodeName !== "option" ) {
     156                        migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
     157                }
    109158                return name in elem ?
    110159                        elem.value :
    111160                        null;
    112161        },
    113         set: function( elem, value, name ) {
    114                 if ( jQuery.nodeName( elem, "button" ) ) {
     162        set: function( elem, value ) {
     163                var nodeName = ( elem.nodeName || "" ).toLowerCase();
     164                if ( nodeName === "button" ) {
    115165                        return valueAttrSet.apply( this, arguments );
    116166                }
    117                 migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
     167                if ( nodeName !== "input" && nodeName !== "option" ) {
     168                        migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
     169                }
    118170                // Does not return so that setAttribute is also used
    119171                elem.value = value;
    120172        }
     
    122174
    123175
    124176var matched, browser,
    125         oldAccess = jQuery.access,
    126177        oldInit = jQuery.fn.init,
    127178        // Note this does NOT include the # XSS fix from 1.7!
    128         rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
     179        rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
    129180
    130181// $(html) "looks like html" rule change
    131182jQuery.fn.init = function( selector, context, rootjQuery ) {
     
    151202};
    152203jQuery.fn.init.prototype = jQuery.fn;
    153204
    154 if ( jQuery.fn.jquery >= "1.9" ) {
    155         // jQuery.access( ..., pass )
    156         jQuery.access = function( elems, fn, key, value, chainable, emptyGet, pass ) {
    157                 var i = 0,
    158                         length = elems.length;
    159 
    160                 if ( key && typeof key === "object" && value ) {
    161                         for ( i in key ) {
    162                                 jQuery.access( elems, fn, i, key[i], true, emptyGet, value );
    163                         }
    164                         return elems;
    165                 } else if ( pass && key != null && value !== undefined ) {
    166                         for ( ; i < length; i++ ) {
    167                                 fn( elems[i], key, value, true );
    168                         }
    169                         return elems;
    170                 }
    171                 return oldAccess.call( jQuery, elems, fn, key, value, chainable, emptyGet );
    172         };
    173 }
    174 
    175205jQuery.uaMatch = function( ua ) {
    176206        ua = ua.toLowerCase();
    177207
     
    250280};
    251281
    252282
    253 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
    254         oldFragment = jQuery.buildFragment;
     283var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
    255284
    256285jQuery.fn.andSelf = function() {
    257286        migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
    258287        return oldSelf.apply( this, arguments );
    259288};
    260289
    261 jQuery.buildFragment = function( args, context, scripts ) {
    262         var fragment;
     290// Since jQuery.clean is used internally on older versions, we only shim if it's missing
     291if ( !jQuery.clean ) {
     292        jQuery.clean = function( elems, context, fragment, scripts, selection ) {
     293                var newFragment = jQuery.buildFragment( elems, context || document, scripts, selection );
    263294
    264         if ( !oldFragment ) {
    265                 // Set context from what may come in as undefined or a jQuery collection or a node
    266                 // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
    267                 // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
    268                 context = context || document;
    269                 context = !context.nodeType && context[0] || context;
    270                 context = context.ownerDocument || context;
     295                migrateWarn("jQuery.clean() is deprecated");
     296                if ( fragment ) {
     297                        fragment.appendChild( newFragment );
    271298
    272                 fragment = context.createDocumentFragment();
    273                 jQuery.clean( args, context, fragment, scripts );
     299                } else {
     300                        fragment = newFragment;
     301                }
    274302
    275                 migrateWarn("jQuery.buildFragment() is deprecated");
    276                 return { fragment: fragment, cacheable: false };
    277         }
    278         // Don't warn if we are in a version where buildFragment is used internally
    279         return oldFragment.apply( this, arguments );
    280 };
     303                return jQuery.merge( [], fragment.childNodes );
     304        };
     305}
    281306
    282307var eventAdd = jQuery.event.add,
    283308        eventRemove = jQuery.event.remove,
     
    314339        eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
    315340};
    316341
    317 jQuery.fn.error = function( data, fn ) {
     342jQuery.fn.error = function() {
    318343        var args = Array.prototype.slice.call( arguments, 0);
    319344        migrateWarn("jQuery.fn.error() is deprecated");
    320345        args.splice( 0, 0, "error" );
     
    387412jQuery.each( ajaxEvents.split("|"),
    388413        function( _, name ) {
    389414                jQuery.event.special[ name ] = {
    390                         setup: function( data ) {
     415                        setup: function() {
    391416                                var elem = this;
    392417
    393418                                // The document needs no shimming; must be !== for oldIE
    394419                                if ( elem !== document ) {
    395                                         jQuery.event.add( document, name + "." + jQuery.guid, function( event ) {
     420                                        jQuery.event.add( document, name + "." + jQuery.guid, function() {
    396421                                                jQuery.event.trigger( name, null, elem, true );
    397422                                        });
    398423                                        jQuery._data( this, name, jQuery.guid++ );
    399424                                }
    400425                                return false;
    401426                        },
    402                         teardown: function( data, handleObj ) {
     427                        teardown: function() {
    403428                                if ( this !== document ) {
    404429                                        jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
    405430                                }
    406431                                return false;
    407432                        }
    408                 }
     433                };
    409434        }
    410435);
    411436