r99262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99261‎ | r99262 | r99263 >
Date:21:32, 7 October 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r99231: upgrade jQuery to 1.6.4, should work around IE8 crashing bug
Modified paths:
  • /branches/REL1_18/phase3/resources/jquery/jquery.js (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/resources/jquery/jquery.js
@@ -1,5 +1,5 @@
22 /*!
3 - * jQuery JavaScript Library v1.6.2
 3+ * jQuery JavaScript Library v1.6.4
44 * http://jquery.com/
55 *
66 * Copyright 2011, John Resig
@@ -11,7 +11,7 @@
1212 * Copyright 2011, The Dojo Foundation
1313 * Released under the MIT, BSD, and GPL Licenses.
1414 *
15 - * Date: Thu Jun 30 14:16:56 2011 -0400
 15+ * Date: Mon Sep 12 18:54:48 2011 -0400
1616 */
1717 (function( window, undefined ) {
1818
@@ -37,8 +37,8 @@
3838 rootjQuery,
3939
4040 // A simple way to check for HTML strings or ID strings
41 - // (both of which we optimize for)
42 - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
 41+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
 42+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
4343
4444 // Check if a string has a non-whitespace character in it
4545 rnotwhite = /\S/,
@@ -66,11 +66,12 @@
6767 rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
6868
6969 // Matches dashed string for camelizing
70 - rdashAlpha = /-([a-z])/ig,
 70+ rdashAlpha = /-([a-z]|[0-9])/ig,
 71+ rmsPrefix = /^-ms-/,
7172
7273 // Used by jQuery.camelCase as callback to replace()
7374 fcamelCase = function( all, letter ) {
74 - return letter.toUpperCase();
 75+ return ( letter + "" ).toUpperCase();
7576 },
7677
7778 // Keep a UserAgent string for use with jQuery.browser
@@ -212,7 +213,7 @@
213214 selector: "",
214215
215216 // The current version of jQuery being used
216 - jquery: "1.6.2",
 217+ jquery: "1.6.4",
217218
218219 // The default length of a jQuery object is 0
219220 length: 0,
@@ -521,10 +522,15 @@
522523 return false;
523524 }
524525
525 - // Not own constructor property must be Object
526 - if ( obj.constructor &&
527 - !hasOwn.call(obj, "constructor") &&
528 - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
 526+ try {
 527+ // Not own constructor property must be Object
 528+ if ( obj.constructor &&
 529+ !hasOwn.call(obj, "constructor") &&
 530+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
 531+ return false;
 532+ }
 533+ } catch ( e ) {
 534+ // IE8,9 Will throw exceptions on certain host objects #9897
529535 return false;
530536 }
531537
@@ -574,24 +580,23 @@
575581 },
576582
577583 // Cross-browser xml parsing
578 - // (xml & tmp used internally)
579 - parseXML: function( data , xml , tmp ) {
580 -
581 - if ( window.DOMParser ) { // Standard
582 - tmp = new DOMParser();
583 - xml = tmp.parseFromString( data , "text/xml" );
584 - } else { // IE
585 - xml = new ActiveXObject( "Microsoft.XMLDOM" );
586 - xml.async = "false";
587 - xml.loadXML( data );
 584+ parseXML: function( data ) {
 585+ var xml, tmp;
 586+ try {
 587+ if ( window.DOMParser ) { // Standard
 588+ tmp = new DOMParser();
 589+ xml = tmp.parseFromString( data , "text/xml" );
 590+ } else { // IE
 591+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
 592+ xml.async = "false";
 593+ xml.loadXML( data );
 594+ }
 595+ } catch( e ) {
 596+ xml = undefined;
588597 }
589 -
590 - tmp = xml.documentElement;
591 -
592 - if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
 598+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
593599 jQuery.error( "Invalid XML: " + data );
594600 }
595 -
596601 return xml;
597602 },
598603
@@ -611,10 +616,10 @@
612617 }
613618 },
614619
615 - // Converts a dashed string to camelCased string;
616 - // Used by both the css and data modules
 620+ // Convert dashed to camelCase; used by the css and data modules
 621+ // Microsoft forgot to hump their vendor prefix (#9572)
617622 camelCase: function( string ) {
618 - return string.replace( rdashAlpha, fcamelCase );
 623+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
619624 },
620625
621626 nodeName: function( elem, name ) {
@@ -699,6 +704,9 @@
700705 },
701706
702707 inArray: function( elem, array ) {
 708+ if ( !array ) {
 709+ return -1;
 710+ }
703711
704712 if ( indexOf ) {
705713 return indexOf.call( array, elem );
@@ -1071,7 +1079,7 @@
10721080 if ( returned && jQuery.isFunction( returned.promise ) ) {
10731081 returned.promise().then( newDefer.resolve, newDefer.reject );
10741082 } else {
1075 - newDefer[ action ]( returned );
 1083+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
10761084 }
10771085 });
10781086 } else {
@@ -1173,6 +1181,7 @@
11741182 div.setAttribute("className", "t");
11751183 div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
11761184
 1185+
11771186 all = div.getElementsByTagName( "*" );
11781187 a = div.getElementsByTagName( "a" )[ 0 ];
11791188
@@ -1293,13 +1302,14 @@
12941303 width: 0,
12951304 height: 0,
12961305 border: 0,
1297 - margin: 0
 1306+ margin: 0,
 1307+ background: "none"
12981308 };
12991309 if ( body ) {
13001310 jQuery.extend( testElementStyle, {
13011311 position: "absolute",
1302 - left: -1000,
1303 - top: -1000
 1312+ left: "-1000px",
 1313+ top: "-1000px"
13041314 });
13051315 }
13061316 for ( i in testElementStyle ) {
@@ -1404,7 +1414,7 @@
14051415
14061416
14071417 var rbrace = /^(?:\{.*\}|\[.*\])$/,
1408 - rmultiDash = /([a-z])([A-Z])/g;
 1418+ rmultiDash = /([A-Z])/g;
14091419
14101420 jQuery.extend({
14111421 cache: {},
@@ -1436,7 +1446,9 @@
14371447 return;
14381448 }
14391449
1440 - var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
 1450+ var thisCache, ret,
 1451+ internalKey = jQuery.expando,
 1452+ getByName = typeof name === "string",
14411453
14421454 // We have to handle DOM nodes and JS objects differently because IE6-7
14431455 // can't GC object references properly across the DOM-JS boundary
@@ -1452,7 +1464,7 @@
14531465
14541466 // Avoid doing any more work than we need to when trying to get data on an
14551467 // object that has no data at all
1456 - if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
 1468+ if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
14571469 return;
14581470 }
14591471
@@ -1511,10 +1523,24 @@
15121524 return thisCache[ internalKey ] && thisCache[ internalKey ].events;
15131525 }
15141526
1515 - return getByName ?
1516 - // Check for both converted-to-camel and non-converted data property names
1517 - thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
1518 - thisCache;
 1527+ // Check for both converted-to-camel and non-converted data property names
 1528+ // If a data property was specified
 1529+ if ( getByName ) {
 1530+
 1531+ // First Try to find as-is property data
 1532+ ret = thisCache[ name ];
 1533+
 1534+ // Test for null|undefined property data
 1535+ if ( ret == null ) {
 1536+
 1537+ // Try to find the camelCased property
 1538+ ret = thisCache[ jQuery.camelCase( name ) ];
 1539+ }
 1540+ } else {
 1541+ ret = thisCache;
 1542+ }
 1543+
 1544+ return ret;
15191545 },
15201546
15211547 removeData: function( elem, name, pvt /* Internal Use Only */ ) {
@@ -1522,8 +1548,13 @@
15231549 return;
15241550 }
15251551
1526 - var internalKey = jQuery.expando, isNode = elem.nodeType,
 1552+ var thisCache,
15271553
 1554+ // Reference to internal data cache key
 1555+ internalKey = jQuery.expando,
 1556+
 1557+ isNode = elem.nodeType,
 1558+
15281559 // See jQuery.data for more information
15291560 cache = isNode ? jQuery.cache : elem,
15301561
@@ -1537,9 +1568,16 @@
15381569 }
15391570
15401571 if ( name ) {
1541 - var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
15421572
 1573+ thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
 1574+
15431575 if ( thisCache ) {
 1576+
 1577+ // Support interoperable removal of hyphenated or camelcased keys
 1578+ if ( !thisCache[ name ] ) {
 1579+ name = jQuery.camelCase( name );
 1580+ }
 1581+
15441582 delete thisCache[ name ];
15451583
15461584 // If there is no data left in the cache, we want to continue
@@ -1566,7 +1604,8 @@
15671605 // Browsers that fail expando deletion also refuse to delete expandos on
15681606 // the window, but it will allow it on all other JS objects; other browsers
15691607 // don't care
1570 - if ( jQuery.support.deleteExpando || cache != window ) {
 1608+ // Ensure that `cache` is not a window object #10080
 1609+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
15711610 delete cache[ id ];
15721611 } else {
15731612 cache[ id ] = null;
@@ -1690,8 +1729,9 @@
16911730 // If nothing was found internally, try to fetch any
16921731 // data from the HTML5 data-* attribute
16931732 if ( data === undefined && elem.nodeType === 1 ) {
1694 - var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
16951733
 1734+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
 1735+
16961736 data = elem.getAttribute( name );
16971737
16981738 if ( typeof data === "string" ) {
@@ -1910,8 +1950,7 @@
19111951 rfocusable = /^(?:button|input|object|select|textarea)$/i,
19121952 rclickable = /^a(?:rea)?$/i,
19131953 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
1914 - rinvalidChar = /\:|^on/,
1915 - formHook, boolHook;
 1954+ nodeHook, boolHook;
19161955
19171956 jQuery.fn.extend({
19181957 attr: function( name, value ) {
@@ -2049,7 +2088,7 @@
20502089 hasClass: function( selector ) {
20512090 var className = " " + selector + " ";
20522091 for ( var i = 0, l = this.length; i < l; i++ ) {
2053 - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
 2092+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
20542093 return true;
20552094 }
20562095 }
@@ -2229,14 +2268,11 @@
22302269 if ( !hooks ) {
22312270 // Use boolHook for boolean attributes
22322271 if ( rboolean.test( name ) ) {
2233 -
22342272 hooks = boolHook;
22352273
2236 - // Use formHook for forms and if the name contains certain characters
2237 - } else if ( formHook && name !== "className" &&
2238 - (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
2239 -
2240 - hooks = formHook;
 2274+ // Use nodeHook if available( IE6/7 )
 2275+ } else if ( nodeHook ) {
 2276+ hooks = nodeHook;
22412277 }
22422278 }
22432279 }
@@ -2273,15 +2309,10 @@
22742310 var propName;
22752311 if ( elem.nodeType === 1 ) {
22762312 name = jQuery.attrFix[ name ] || name;
2277 -
2278 - if ( jQuery.support.getSetAttribute ) {
2279 - // Use removeAttribute in browsers that support it
2280 - elem.removeAttribute( name );
2281 - } else {
2282 - jQuery.attr( elem, name, "" );
2283 - elem.removeAttributeNode( elem.getAttributeNode( name ) );
2284 - }
22852313
 2314+ jQuery.attr( elem, name, "" );
 2315+ elem.removeAttribute( name );
 2316+
22862317 // Set corresponding property to false for boolean attributes
22872318 if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
22882319 elem[ propName ] = false;
@@ -2308,33 +2339,20 @@
23092340 }
23102341 }
23112342 },
2312 - tabIndex: {
2313 - get: function( elem ) {
2314 - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2315 - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2316 - var attributeNode = elem.getAttributeNode("tabIndex");
2317 -
2318 - return attributeNode && attributeNode.specified ?
2319 - parseInt( attributeNode.value, 10 ) :
2320 - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2321 - 0 :
2322 - undefined;
2323 - }
2324 - },
23252343 // Use the value property for back compat
2326 - // Use the formHook for button elements in IE6/7 (#1954)
 2344+ // Use the nodeHook for button elements in IE6/7 (#1954)
23272345 value: {
23282346 get: function( elem, name ) {
2329 - if ( formHook && jQuery.nodeName( elem, "button" ) ) {
2330 - return formHook.get( elem, name );
 2347+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
 2348+ return nodeHook.get( elem, name );
23312349 }
23322350 return name in elem ?
23332351 elem.value :
23342352 null;
23352353 },
23362354 set: function( elem, value, name ) {
2337 - if ( formHook && jQuery.nodeName( elem, "button" ) ) {
2338 - return formHook.set( elem, value, name );
 2355+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
 2356+ return nodeHook.set( elem, value, name );
23392357 }
23402358 // Does not return so that setAttribute is also used
23412359 elem.value = value;
@@ -2383,7 +2401,7 @@
23842402 }
23852403
23862404 } else {
2387 - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
 2405+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
23882406 return ret;
23892407
23902408 } else {
@@ -2392,14 +2410,33 @@
23932411 }
23942412 },
23952413
2396 - propHooks: {}
 2414+ propHooks: {
 2415+ tabIndex: {
 2416+ get: function( elem ) {
 2417+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
 2418+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
 2419+ var attributeNode = elem.getAttributeNode("tabindex");
 2420+
 2421+ return attributeNode && attributeNode.specified ?
 2422+ parseInt( attributeNode.value, 10 ) :
 2423+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
 2424+ 0 :
 2425+ undefined;
 2426+ }
 2427+ }
 2428+ }
23972429 });
23982430
 2431+// Add the tabindex propHook to attrHooks for back-compat
 2432+jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
 2433+
23992434 // Hook for boolean attributes
24002435 boolHook = {
24012436 get: function( elem, name ) {
24022437 // Align boolean attributes with corresponding properties
2403 - return jQuery.prop( elem, name ) ?
 2438+ // Fall back to attribute presence where some booleans are not supported
 2439+ var attrNode;
 2440+ return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
24042441 name.toLowerCase() :
24052442 undefined;
24062443 },
@@ -2425,12 +2462,10 @@
24262463
24272464 // IE6/7 do not support getting/setting some attributes with get/setAttribute
24282465 if ( !jQuery.support.getSetAttribute ) {
2429 -
2430 - // propFix is more comprehensive and contains all fixes
2431 - jQuery.attrFix = jQuery.propFix;
24322466
2433 - // Use this for any attribute on a form in IE6/7
2434 - formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
 2467+ // Use this for any attribute in IE6/7
 2468+ // This fixes almost every IE6/7 issue
 2469+ nodeHook = jQuery.valHooks.button = {
24352470 get: function( elem, name ) {
24362471 var ret;
24372472 ret = elem.getAttributeNode( name );
@@ -2440,13 +2475,13 @@
24412476 undefined;
24422477 },
24432478 set: function( elem, value, name ) {
2444 - // Check form objects in IE (multiple bugs related)
2445 - // Only use nodeValue if the attribute node exists on the form
 2479+ // Set the existing or create a new attribute node
24462480 var ret = elem.getAttributeNode( name );
2447 - if ( ret ) {
2448 - ret.nodeValue = value;
2449 - return value;
 2481+ if ( !ret ) {
 2482+ ret = document.createAttribute( name );
 2483+ elem.setAttributeNode( ret );
24502484 }
 2485+ return (ret.nodeValue = value + "");
24512486 }
24522487 };
24532488
@@ -2505,6 +2540,7 @@
25062541 parent.parentNode.selectedIndex;
25072542 }
25082543 }
 2544+ return null;
25092545 }
25102546 });
25112547 }
@@ -3235,8 +3271,9 @@
32363272 setup: function( data, namespaces ) {
32373273 if ( !jQuery.nodeName( this, "form" ) ) {
32383274 jQuery.event.add(this, "click.specialSubmit", function( e ) {
 3275+ // Avoid triggering error on non-existent type attribute in IE VML (#7071)
32393276 var elem = e.target,
3240 - type = elem.type;
 3277+ type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
32413278
32423279 if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
32433280 trigger( "submit", this, arguments );
@@ -3245,7 +3282,7 @@
32463283
32473284 jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
32483285 var elem = e.target,
3249 - type = elem.type;
 3286+ type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
32503287
32513288 if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
32523289 trigger( "submit", this, arguments );
@@ -3270,7 +3307,8 @@
32713308 var changeFilters,
32723309
32733310 getVal = function( elem ) {
3274 - var type = elem.type, val = elem.value;
 3311+ var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
 3312+ val = elem.value;
32753313
32763314 if ( type === "radio" || type === "checkbox" ) {
32773315 val = elem.checked;
@@ -5295,12 +5333,17 @@
52965334 // Determine the position of an element within
52975335 // the matched set of elements
52985336 index: function( elem ) {
5299 - if ( !elem || typeof elem === "string" ) {
5300 - return jQuery.inArray( this[0],
5301 - // If it receives a string, the selector is used
5302 - // If it receives nothing, the siblings are used
5303 - elem ? jQuery( elem ) : this.parent().children() );
 5337+
 5338+ // No argument, return index in parent
 5339+ if ( !elem ) {
 5340+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
53045341 }
 5342+
 5343+ // index in selector
 5344+ if ( typeof elem === "string" ) {
 5345+ return jQuery.inArray( this[0], jQuery( elem ) );
 5346+ }
 5347+
53055348 // Locate the position of the desired element
53065349 return jQuery.inArray(
53075350 // If it receives a jQuery object, the first element is used
@@ -6048,7 +6091,10 @@
60496092 // with an element if you are cloning the body and one of the
60506093 // elements on the page has a name or id of "length"
60516094 for ( i = 0; srcElements[i]; ++i ) {
6052 - cloneFixAttributes( srcElements[i], destElements[i] );
 6095+ // Ensure that the destination node is not null; Fixes #9587
 6096+ if ( destElements[i] ) {
 6097+ cloneFixAttributes( srcElements[i], destElements[i] );
 6098+ }
60536099 }
60546100 }
60556101
@@ -6248,14 +6294,14 @@
62496295
62506296
62516297
 6298+
62526299 var ralpha = /alpha\([^)]*\)/i,
62536300 ropacity = /opacity=([^)]*)/,
62546301 // fixed for IE9, see #8346
62556302 rupper = /([A-Z]|^ms)/g,
62566303 rnumpx = /^-?\d+(?:px)?$/i,
62576304 rnum = /^-?\d/,
6258 - rrelNum = /^[+\-]=/,
6259 - rrelNumFilter = /[^+\-\.\de]+/g,
 6305+ rrelNum = /^([\-+])=([\-+.\de]+)/,
62606306
62616307 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
62626308 cssWidth = [ "Left", "Right" ],
@@ -6332,18 +6378,18 @@
63336379 if ( value !== undefined ) {
63346380 type = typeof value;
63356381
6336 - // Make sure that NaN and null values aren't set. See: #7116
6337 - if ( type === "number" && isNaN( value ) || value == null ) {
6338 - return;
6339 - }
6340 -
63416382 // convert relative number strings (+= or -=) to relative numbers. #7345
6342 - if ( type === "string" && rrelNum.test( value ) ) {
6343 - value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
 6383+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
 6384+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
63446385 // Fixes bug #9237
63456386 type = "number";
63466387 }
63476388
 6389+ // Make sure that NaN and null values aren't set. See: #7116
 6390+ if ( value == null || type === "number" && isNaN( value ) ) {
 6391+ return;
 6392+ }
 6393+
63486394 // If a number was passed in, add 'px' to the (except for certain CSS properties)
63496395 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
63506396 value += "px";
@@ -6459,18 +6505,29 @@
64606506
64616507 set: function( elem, value ) {
64626508 var style = elem.style,
6463 - currentStyle = elem.currentStyle;
 6509+ currentStyle = elem.currentStyle,
 6510+ opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
 6511+ filter = currentStyle && currentStyle.filter || style.filter || "";
64646512
64656513 // IE has trouble with opacity if it does not have layout
64666514 // Force it by setting the zoom level
64676515 style.zoom = 1;
64686516
6469 - // Set the alpha filter to set the opacity
6470 - var opacity = jQuery.isNaN( value ) ?
6471 - "" :
6472 - "alpha(opacity=" + value * 100 + ")",
6473 - filter = currentStyle && currentStyle.filter || style.filter || "";
 6517+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
 6518+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
64746519
 6520+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
 6521+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
 6522+ // style.removeAttribute is IE Only, but so apparently is this code path...
 6523+ style.removeAttribute( "filter" );
 6524+
 6525+ // if there there is no filter style applied in a css rule, we are done
 6526+ if ( currentStyle && !currentStyle.filter ) {
 6527+ return;
 6528+ }
 6529+ }
 6530+
 6531+ // otherwise, set new filter values
64756532 style.filter = ralpha.test( filter ) ?
64766533 filter.replace( ralpha, opacity ) :
64776534 filter + " " + opacity;
@@ -6625,9 +6682,9 @@
66266683 rCRLF = /\r?\n/g,
66276684 rhash = /#.*$/,
66286685 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6629 - rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
 6686+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
66306687 // #7653, #8125, #8152: local protocol detection
6631 - rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
 6688+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
66326689 rnoContent = /^(?:GET|HEAD)$/,
66336690 rprotocol = /^\/\//,
66346691 rquery = /\?/,
@@ -6662,7 +6719,10 @@
66636720 ajaxLocation,
66646721
66656722 // Document location segments
6666 - ajaxLocParts;
 6723+ ajaxLocParts,
 6724+
 6725+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
 6726+ allTypes = ["*/"] + ["*"];
66676727
66686728 // #8138, IE may throw an exception when accessing
66696729 // a field from window.location if document.domain has been set
@@ -6755,6 +6815,22 @@
67566816 return selection;
67576817 }
67586818
 6819+// A special extend for ajax options
 6820+// that takes "flat" options (not to be deep extended)
 6821+// Fixes #9887
 6822+function ajaxExtend( target, src ) {
 6823+ var key, deep,
 6824+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
 6825+ for( key in src ) {
 6826+ if ( src[ key ] !== undefined ) {
 6827+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
 6828+ }
 6829+ }
 6830+ if ( deep ) {
 6831+ jQuery.extend( true, target, deep );
 6832+ }
 6833+}
 6834+
67596835 jQuery.fn.extend({
67606836 load: function( url, params, callback ) {
67616837 if ( typeof url !== "string" && _load ) {
@@ -6898,23 +6974,16 @@
68996975 // Creates a full fledged settings object into target
69006976 // with both ajaxSettings and settings fields.
69016977 // If target is omitted, writes into ajaxSettings.
6902 - ajaxSetup: function ( target, settings ) {
6903 - if ( !settings ) {
6904 - // Only one parameter, we extend ajaxSettings
 6978+ ajaxSetup: function( target, settings ) {
 6979+ if ( settings ) {
 6980+ // Building a settings object
 6981+ ajaxExtend( target, jQuery.ajaxSettings );
 6982+ } else {
 6983+ // Extending ajaxSettings
69056984 settings = target;
6906 - target = jQuery.extend( true, jQuery.ajaxSettings, settings );
6907 - } else {
6908 - // target was provided, we extend into it
6909 - jQuery.extend( true, target, jQuery.ajaxSettings, settings );
 6985+ target = jQuery.ajaxSettings;
69106986 }
6911 - // Flatten fields we don't want deep extended
6912 - for( var field in { context: 1, url: 1 } ) {
6913 - if ( field in settings ) {
6914 - target[ field ] = settings[ field ];
6915 - } else if( field in jQuery.ajaxSettings ) {
6916 - target[ field ] = jQuery.ajaxSettings[ field ];
6917 - }
6918 - }
 6987+ ajaxExtend( target, settings );
69196988 return target;
69206989 },
69216990
@@ -6942,7 +7011,7 @@
69437012 html: "text/html",
69447013 text: "text/plain",
69457014 json: "application/json, text/javascript",
6946 - "*": "*/*"
 7015+ "*": allTypes
69477016 },
69487017
69497018 contents: {
@@ -6972,6 +7041,15 @@
69737042
69747043 // Parse text as xml
69757044 "text xml": jQuery.parseXML
 7045+ },
 7046+
 7047+ // For options that shouldn't be deep extended:
 7048+ // you can add your own custom options here if
 7049+ // and when you create one that shouldn't be
 7050+ // deep extended (see ajaxExtend)
 7051+ flatOptions: {
 7052+ context: true,
 7053+ url: true
69767054 }
69777055 },
69787056
@@ -7082,7 +7160,7 @@
70837161 // Callback for when everything is done
70847162 // It is defined here because jslint complains if it is declared
70857163 // at the end of the function (which would be more logical and readable)
7086 - function done( status, statusText, responses, headers ) {
 7164+ function done( status, nativeStatusText, responses, headers ) {
70877165
70887166 // Called once
70897167 if ( state === 2 ) {
@@ -7105,11 +7183,12 @@
71067184 responseHeadersString = headers || "";
71077185
71087186 // Set readyState
7109 - jqXHR.readyState = status ? 4 : 0;
 7187+ jqXHR.readyState = status > 0 ? 4 : 0;
71107188
71117189 var isSuccess,
71127190 success,
71137191 error,
 7192+ statusText = nativeStatusText,
71147193 response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
71157194 lastModified,
71167195 etag;
@@ -7161,7 +7240,7 @@
71627241
71637242 // Set data for the fake xhr object
71647243 jqXHR.status = status;
7165 - jqXHR.statusText = statusText;
 7244+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
71667245
71677246 // Success/Error
71687247 if ( isSuccess ) {
@@ -7183,7 +7262,7 @@
71847263 completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
71857264
71867265 if ( fireGlobals ) {
7187 - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
 7266+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
71887267 // Handle the global AJAX counter
71897268 if ( !( --jQuery.active ) ) {
71907269 jQuery.event.trigger( "ajaxStop" );
@@ -7264,6 +7343,8 @@
72657344 // If data is available, append data to url
72667345 if ( s.data ) {
72677346 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
 7347+ // #9682: remove data so that it's not used in an eventual retry
 7348+ delete s.data;
72687349 }
72697350
72707351 // Get ifModifiedKey before adding the anti-cache parameter
@@ -7301,7 +7382,7 @@
73027383 jqXHR.setRequestHeader(
73037384 "Accept",
73047385 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7305 - s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
 7386+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
73067387 s.accepts[ "*" ]
73077388 );
73087389
@@ -7347,7 +7428,7 @@
73487429 transport.send( requestHeaders, done );
73497430 } catch (e) {
73507431 // Propagate exception as error if not done
7351 - if ( status < 2 ) {
 7432+ if ( state < 2 ) {
73527433 done( -1, e );
73537434 // Simply rethrow otherwise
73547435 } else {
@@ -7995,10 +8076,7 @@
79968077 // opacity animations
79978078 [ "opacity" ]
79988079 ],
7999 - fxNow,
8000 - requestAnimationFrame = window.webkitRequestAnimationFrame ||
8001 - window.mozRequestAnimationFrame ||
8002 - window.oRequestAnimationFrame;
 8080+ fxNow;
80038081
80048082 jQuery.fn.extend({
80058083 show: function( speed, easing, callback ) {
@@ -8374,8 +8452,7 @@
83758453 // Start an animation from one number to another
83768454 custom: function( from, to, unit ) {
83778455 var self = this,
8378 - fx = jQuery.fx,
8379 - raf;
 8456+ fx = jQuery.fx;
83808457
83818458 this.startTime = fxNow || createFxNow();
83828459 this.start = from;
@@ -8391,20 +8468,7 @@
83928469 t.elem = this.elem;
83938470
83948471 if ( t() && jQuery.timers.push(t) && !timerId ) {
8395 - // Use requestAnimationFrame instead of setInterval if available
8396 - if ( requestAnimationFrame ) {
8397 - timerId = true;
8398 - raf = function() {
8399 - // When timerId gets set to null at any point, this stops
8400 - if ( timerId ) {
8401 - requestAnimationFrame( raf );
8402 - fx.tick();
8403 - }
8404 - };
8405 - requestAnimationFrame( raf );
8406 - } else {
8407 - timerId = setInterval( fx.tick, fx.interval );
8408 - }
 8472+ timerId = setInterval( fx.tick, fx.interval );
84098473 }
84108474 },
84118475
@@ -8947,9 +9011,10 @@
89489012 if ( jQuery.isWindow( elem ) ) {
89499013 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
89509014 // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
8951 - var docElemProp = elem.document.documentElement[ "client" + name ];
 9015+ var docElemProp = elem.document.documentElement[ "client" + name ],
 9016+ body = elem.document.body;
89529017 return elem.document.compatMode === "CSS1Compat" && docElemProp ||
8953 - elem.document.body[ "client" + name ] || docElemProp;
 9018+ body && body[ "client" + name ] || docElemProp;
89549019
89559020 // Get document width or height
89569021 } else if ( elem.nodeType === 9 ) {
@@ -8978,4 +9043,4 @@
89799044
89809045 // Expose jQuery to the global object
89819046 window.jQuery = window.$ = jQuery;
8982 -})(window);
\ No newline at end of file
 9047+})(window);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99231upgrading to jquery 1.6.4 to fix bug #31424neilk18:53, 7 October 2011

Status & tagging log