jquery-source 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Jquery
2
2
  module Source
3
- VERSION = "1.6.2"
3
+ VERSION = "1.6.3"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jQuery JavaScript Library v1.6.2
2
+ * jQuery JavaScript Library v1.6.3
3
3
  * http://jquery.com/
4
4
  *
5
5
  * Copyright 2011, John Resig
@@ -11,7 +11,7 @@
11
11
  * Copyright 2011, The Dojo Foundation
12
12
  * Released under the MIT, BSD, and GPL Licenses.
13
13
  *
14
- * Date: Thu Jun 30 14:16:56 2011 -0400
14
+ * Date: Wed Aug 31 10:35:15 2011 -0400
15
15
  */
16
16
  (function( window, undefined ) {
17
17
 
@@ -37,8 +37,8 @@ var jQuery = function( selector, context ) {
37
37
  rootjQuery,
38
38
 
39
39
  // A simple way to check for HTML strings or ID strings
40
- // (both of which we optimize for)
41
- quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
40
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
41
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
42
42
 
43
43
  // Check if a string has a non-whitespace character in it
44
44
  rnotwhite = /\S/,
@@ -66,11 +66,12 @@ var jQuery = function( selector, context ) {
66
66
  rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
67
67
 
68
68
  // Matches dashed string for camelizing
69
- rdashAlpha = /-([a-z])/ig,
69
+ rdashAlpha = /-([a-z]|[0-9])/ig,
70
+ rmsPrefix = /^-ms-/,
70
71
 
71
72
  // Used by jQuery.camelCase as callback to replace()
72
73
  fcamelCase = function( all, letter ) {
73
- return letter.toUpperCase();
74
+ return ( letter + "" ).toUpperCase();
74
75
  },
75
76
 
76
77
  // Keep a UserAgent string for use with jQuery.browser
@@ -212,7 +213,7 @@ jQuery.fn = jQuery.prototype = {
212
213
  selector: "",
213
214
 
214
215
  // The current version of jQuery being used
215
- jquery: "1.6.2",
216
+ jquery: "1.6.3",
216
217
 
217
218
  // The default length of a jQuery object is 0
218
219
  length: 0,
@@ -521,10 +522,15 @@ jQuery.extend({
521
522
  return false;
522
523
  }
523
524
 
524
- // Not own constructor property must be Object
525
- if ( obj.constructor &&
526
- !hasOwn.call(obj, "constructor") &&
527
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
525
+ try {
526
+ // Not own constructor property must be Object
527
+ if ( obj.constructor &&
528
+ !hasOwn.call(obj, "constructor") &&
529
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
530
+ return false;
531
+ }
532
+ } catch ( e ) {
533
+ // IE8,9 Will throw exceptions on certain host objects #9897
528
534
  return false;
529
535
  }
530
536
 
@@ -574,24 +580,23 @@ jQuery.extend({
574
580
  },
575
581
 
576
582
  // Cross-browser xml parsing
577
- // (xml & tmp used internally)
578
- parseXML: function( data , xml , tmp ) {
579
-
580
- if ( window.DOMParser ) { // Standard
581
- tmp = new DOMParser();
582
- xml = tmp.parseFromString( data , "text/xml" );
583
- } else { // IE
584
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
585
- xml.async = "false";
586
- xml.loadXML( data );
587
- }
588
-
589
- tmp = xml.documentElement;
590
-
591
- if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
583
+ parseXML: function( data ) {
584
+ var xml, tmp;
585
+ try {
586
+ if ( window.DOMParser ) { // Standard
587
+ tmp = new DOMParser();
588
+ xml = tmp.parseFromString( data , "text/xml" );
589
+ } else { // IE
590
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
591
+ xml.async = "false";
592
+ xml.loadXML( data );
593
+ }
594
+ } catch( e ) {
595
+ xml = undefined;
596
+ }
597
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
592
598
  jQuery.error( "Invalid XML: " + data );
593
599
  }
594
-
595
600
  return xml;
596
601
  },
597
602
 
@@ -611,10 +616,10 @@ jQuery.extend({
611
616
  }
612
617
  },
613
618
 
614
- // Converts a dashed string to camelCased string;
615
- // Used by both the css and data modules
619
+ // Convert dashed to camelCase; used by the css and data modules
620
+ // Microsoft forgot to hump their vendor prefix (#9572)
616
621
  camelCase: function( string ) {
617
- return string.replace( rdashAlpha, fcamelCase );
622
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
618
623
  },
619
624
 
620
625
  nodeName: function( elem, name ) {
@@ -699,6 +704,9 @@ jQuery.extend({
699
704
  },
700
705
 
701
706
  inArray: function( elem, array ) {
707
+ if ( !array ) {
708
+ return -1;
709
+ }
702
710
 
703
711
  if ( indexOf ) {
704
712
  return indexOf.call( array, elem );
@@ -1071,7 +1079,7 @@ jQuery.extend({
1071
1079
  if ( returned && jQuery.isFunction( returned.promise ) ) {
1072
1080
  returned.promise().then( newDefer.resolve, newDefer.reject );
1073
1081
  } else {
1074
- newDefer[ action ]( returned );
1082
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
1075
1083
  }
1076
1084
  });
1077
1085
  } else {
@@ -1171,7 +1179,8 @@ jQuery.support = (function() {
1171
1179
 
1172
1180
  // Preliminary tests
1173
1181
  div.setAttribute("className", "t");
1174
- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
1182
+ div.innerHTML = " <link><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type=checkbox>";
1183
+
1175
1184
 
1176
1185
  all = div.getElementsByTagName( "*" );
1177
1186
  a = div.getElementsByTagName( "a" )[ 0 ];
@@ -1293,13 +1302,14 @@ jQuery.support = (function() {
1293
1302
  width: 0,
1294
1303
  height: 0,
1295
1304
  border: 0,
1296
- margin: 0
1305
+ margin: 0,
1306
+ background: "none"
1297
1307
  };
1298
1308
  if ( body ) {
1299
1309
  jQuery.extend( testElementStyle, {
1300
1310
  position: "absolute",
1301
- left: -1000,
1302
- top: -1000
1311
+ left: "-1000px",
1312
+ top: "-1000px"
1303
1313
  });
1304
1314
  }
1305
1315
  for ( i in testElementStyle ) {
@@ -1436,7 +1446,9 @@ jQuery.extend({
1436
1446
  return;
1437
1447
  }
1438
1448
 
1439
- var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
1449
+ var thisCache, ret,
1450
+ internalKey = jQuery.expando,
1451
+ getByName = typeof name === "string",
1440
1452
 
1441
1453
  // We have to handle DOM nodes and JS objects differently because IE6-7
1442
1454
  // can't GC object references properly across the DOM-JS boundary
@@ -1452,7 +1464,7 @@ jQuery.extend({
1452
1464
 
1453
1465
  // Avoid doing any more work than we need to when trying to get data on an
1454
1466
  // object that has no data at all
1455
- if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
1467
+ if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
1456
1468
  return;
1457
1469
  }
1458
1470
 
@@ -1511,10 +1523,24 @@ jQuery.extend({
1511
1523
  return thisCache[ internalKey ] && thisCache[ internalKey ].events;
1512
1524
  }
1513
1525
 
1514
- return getByName ?
1515
- // Check for both converted-to-camel and non-converted data property names
1516
- thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
1517
- thisCache;
1526
+ // Check for both converted-to-camel and non-converted data property names
1527
+ // If a data property was specified
1528
+ if ( getByName ) {
1529
+
1530
+ // First Try to find as-is property data
1531
+ ret = thisCache[ name ];
1532
+
1533
+ // Test for null|undefined property data
1534
+ if ( ret == null ) {
1535
+
1536
+ // Try to find the camelCased property
1537
+ ret = thisCache[ jQuery.camelCase( name ) ];
1538
+ }
1539
+ } else {
1540
+ ret = thisCache;
1541
+ }
1542
+
1543
+ return ret;
1518
1544
  },
1519
1545
 
1520
1546
  removeData: function( elem, name, pvt /* Internal Use Only */ ) {
@@ -1522,7 +1548,12 @@ jQuery.extend({
1522
1548
  return;
1523
1549
  }
1524
1550
 
1525
- var internalKey = jQuery.expando, isNode = elem.nodeType,
1551
+ var thisCache,
1552
+
1553
+ // Reference to internal data cache key
1554
+ internalKey = jQuery.expando,
1555
+
1556
+ isNode = elem.nodeType,
1526
1557
 
1527
1558
  // See jQuery.data for more information
1528
1559
  cache = isNode ? jQuery.cache : elem,
@@ -1537,9 +1568,16 @@ jQuery.extend({
1537
1568
  }
1538
1569
 
1539
1570
  if ( name ) {
1540
- var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
1571
+
1572
+ thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
1541
1573
 
1542
1574
  if ( thisCache ) {
1575
+
1576
+ // Support interoperable removal of hyphenated or camelcased keys
1577
+ if ( !thisCache[ name ] ) {
1578
+ name = jQuery.camelCase( name );
1579
+ }
1580
+
1543
1581
  delete thisCache[ name ];
1544
1582
 
1545
1583
  // If there is no data left in the cache, we want to continue
@@ -1566,7 +1604,8 @@ jQuery.extend({
1566
1604
  // Browsers that fail expando deletion also refuse to delete expandos on
1567
1605
  // the window, but it will allow it on all other JS objects; other browsers
1568
1606
  // don't care
1569
- if ( jQuery.support.deleteExpando || cache != window ) {
1607
+ // Ensure that `cache` is not a window object #10080
1608
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
1570
1609
  delete cache[ id ];
1571
1610
  } else {
1572
1611
  cache[ id ] = null;
@@ -1910,8 +1949,7 @@ var rclass = /[\n\t\r]/g,
1910
1949
  rfocusable = /^(?:button|input|object|select|textarea)$/i,
1911
1950
  rclickable = /^a(?:rea)?$/i,
1912
1951
  rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
1913
- rinvalidChar = /\:|^on/,
1914
- formHook, boolHook;
1952
+ nodeHook, boolHook;
1915
1953
 
1916
1954
  jQuery.fn.extend({
1917
1955
  attr: function( name, value ) {
@@ -2049,7 +2087,7 @@ jQuery.fn.extend({
2049
2087
  hasClass: function( selector ) {
2050
2088
  var className = " " + selector + " ";
2051
2089
  for ( var i = 0, l = this.length; i < l; i++ ) {
2052
- if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
2090
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
2053
2091
  return true;
2054
2092
  }
2055
2093
  }
@@ -2229,14 +2267,11 @@ jQuery.extend({
2229
2267
  if ( !hooks ) {
2230
2268
  // Use boolHook for boolean attributes
2231
2269
  if ( rboolean.test( name ) ) {
2232
-
2233
2270
  hooks = boolHook;
2234
2271
 
2235
- // Use formHook for forms and if the name contains certain characters
2236
- } else if ( formHook && name !== "className" &&
2237
- (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
2238
-
2239
- hooks = formHook;
2272
+ // Use nodeHook if available( IE6/7 )
2273
+ } else if ( nodeHook ) {
2274
+ hooks = nodeHook;
2240
2275
  }
2241
2276
  }
2242
2277
  }
@@ -2273,14 +2308,9 @@ jQuery.extend({
2273
2308
  var propName;
2274
2309
  if ( elem.nodeType === 1 ) {
2275
2310
  name = jQuery.attrFix[ name ] || name;
2276
-
2277
- if ( jQuery.support.getSetAttribute ) {
2278
- // Use removeAttribute in browsers that support it
2279
- elem.removeAttribute( name );
2280
- } else {
2281
- jQuery.attr( elem, name, "" );
2282
- elem.removeAttributeNode( elem.getAttributeNode( name ) );
2283
- }
2311
+
2312
+ jQuery.attr( elem, name, "" );
2313
+ elem.removeAttribute( name );
2284
2314
 
2285
2315
  // Set corresponding property to false for boolean attributes
2286
2316
  if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
@@ -2308,33 +2338,20 @@ jQuery.extend({
2308
2338
  }
2309
2339
  }
2310
2340
  },
2311
- tabIndex: {
2312
- get: function( elem ) {
2313
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2314
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2315
- var attributeNode = elem.getAttributeNode("tabIndex");
2316
-
2317
- return attributeNode && attributeNode.specified ?
2318
- parseInt( attributeNode.value, 10 ) :
2319
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2320
- 0 :
2321
- undefined;
2322
- }
2323
- },
2324
2341
  // Use the value property for back compat
2325
- // Use the formHook for button elements in IE6/7 (#1954)
2342
+ // Use the nodeHook for button elements in IE6/7 (#1954)
2326
2343
  value: {
2327
2344
  get: function( elem, name ) {
2328
- if ( formHook && jQuery.nodeName( elem, "button" ) ) {
2329
- return formHook.get( elem, name );
2345
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2346
+ return nodeHook.get( elem, name );
2330
2347
  }
2331
2348
  return name in elem ?
2332
2349
  elem.value :
2333
2350
  null;
2334
2351
  },
2335
2352
  set: function( elem, value, name ) {
2336
- if ( formHook && jQuery.nodeName( elem, "button" ) ) {
2337
- return formHook.set( elem, value, name );
2353
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
2354
+ return nodeHook.set( elem, value, name );
2338
2355
  }
2339
2356
  // Does not return so that setAttribute is also used
2340
2357
  elem.value = value;
@@ -2383,7 +2400,7 @@ jQuery.extend({
2383
2400
  }
2384
2401
 
2385
2402
  } else {
2386
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
2403
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2387
2404
  return ret;
2388
2405
 
2389
2406
  } else {
@@ -2392,14 +2409,33 @@ jQuery.extend({
2392
2409
  }
2393
2410
  },
2394
2411
 
2395
- propHooks: {}
2412
+ propHooks: {
2413
+ tabIndex: {
2414
+ get: function( elem ) {
2415
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2416
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2417
+ var attributeNode = elem.getAttributeNode("tabindex");
2418
+
2419
+ return attributeNode && attributeNode.specified ?
2420
+ parseInt( attributeNode.value, 10 ) :
2421
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2422
+ 0 :
2423
+ undefined;
2424
+ }
2425
+ }
2426
+ }
2396
2427
  });
2397
2428
 
2429
+ // Add the tabindex propHook to attrHooks for back-compat
2430
+ jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
2431
+
2398
2432
  // Hook for boolean attributes
2399
2433
  boolHook = {
2400
2434
  get: function( elem, name ) {
2401
2435
  // Align boolean attributes with corresponding properties
2402
- return jQuery.prop( elem, name ) ?
2436
+ // Fall back to attribute presence where some booleans are not supported
2437
+ var attrNode;
2438
+ return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
2403
2439
  name.toLowerCase() :
2404
2440
  undefined;
2405
2441
  },
@@ -2425,12 +2461,10 @@ boolHook = {
2425
2461
 
2426
2462
  // IE6/7 do not support getting/setting some attributes with get/setAttribute
2427
2463
  if ( !jQuery.support.getSetAttribute ) {
2428
-
2429
- // propFix is more comprehensive and contains all fixes
2430
- jQuery.attrFix = jQuery.propFix;
2431
2464
 
2432
- // Use this for any attribute on a form in IE6/7
2433
- formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
2465
+ // Use this for any attribute in IE6/7
2466
+ // This fixes almost every IE6/7 issue
2467
+ nodeHook = jQuery.valHooks.button = {
2434
2468
  get: function( elem, name ) {
2435
2469
  var ret;
2436
2470
  ret = elem.getAttributeNode( name );
@@ -2440,13 +2474,13 @@ if ( !jQuery.support.getSetAttribute ) {
2440
2474
  undefined;
2441
2475
  },
2442
2476
  set: function( elem, value, name ) {
2443
- // Check form objects in IE (multiple bugs related)
2444
- // Only use nodeValue if the attribute node exists on the form
2477
+ // Set the existing or create a new attribute node
2445
2478
  var ret = elem.getAttributeNode( name );
2446
- if ( ret ) {
2447
- ret.nodeValue = value;
2448
- return value;
2479
+ if ( !ret ) {
2480
+ ret = document.createAttribute( name );
2481
+ elem.setAttributeNode( ret );
2449
2482
  }
2483
+ return (ret.nodeValue = value + "");
2450
2484
  }
2451
2485
  };
2452
2486
 
@@ -2505,6 +2539,7 @@ if ( !jQuery.support.optSelected ) {
2505
2539
  parent.parentNode.selectedIndex;
2506
2540
  }
2507
2541
  }
2542
+ return null;
2508
2543
  }
2509
2544
  });
2510
2545
  }
@@ -3236,7 +3271,7 @@ if ( !jQuery.support.submitBubbles ) {
3236
3271
  if ( !jQuery.nodeName( this, "form" ) ) {
3237
3272
  jQuery.event.add(this, "click.specialSubmit", function( e ) {
3238
3273
  var elem = e.target,
3239
- type = elem.type;
3274
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
3240
3275
 
3241
3276
  if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
3242
3277
  trigger( "submit", this, arguments );
@@ -3245,7 +3280,7 @@ if ( !jQuery.support.submitBubbles ) {
3245
3280
 
3246
3281
  jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
3247
3282
  var elem = e.target,
3248
- type = elem.type;
3283
+ type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
3249
3284
 
3250
3285
  if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
3251
3286
  trigger( "submit", this, arguments );
@@ -3270,7 +3305,8 @@ if ( !jQuery.support.changeBubbles ) {
3270
3305
  var changeFilters,
3271
3306
 
3272
3307
  getVal = function( elem ) {
3273
- var type = elem.type, val = elem.value;
3308
+ var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
3309
+ val = elem.value;
3274
3310
 
3275
3311
  if ( type === "radio" || type === "checkbox" ) {
3276
3312
  val = elem.checked;
@@ -5295,12 +5331,17 @@ jQuery.fn.extend({
5295
5331
  // Determine the position of an element within
5296
5332
  // the matched set of elements
5297
5333
  index: function( elem ) {
5298
- if ( !elem || typeof elem === "string" ) {
5299
- return jQuery.inArray( this[0],
5300
- // If it receives a string, the selector is used
5301
- // If it receives nothing, the siblings are used
5302
- elem ? jQuery( elem ) : this.parent().children() );
5334
+
5335
+ // No argument, return index in parent
5336
+ if ( !elem ) {
5337
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
5303
5338
  }
5339
+
5340
+ // index in selector
5341
+ if ( typeof elem === "string" ) {
5342
+ return jQuery.inArray( this[0], jQuery( elem ) );
5343
+ }
5344
+
5304
5345
  // Locate the position of the desired element
5305
5346
  return jQuery.inArray(
5306
5347
  // If it receives a jQuery object, the first element is used
@@ -6048,7 +6089,10 @@ jQuery.extend({
6048
6089
  // with an element if you are cloning the body and one of the
6049
6090
  // elements on the page has a name or id of "length"
6050
6091
  for ( i = 0; srcElements[i]; ++i ) {
6051
- cloneFixAttributes( srcElements[i], destElements[i] );
6092
+ // Ensure that the destination node is not null; Fixes #9587
6093
+ if ( destElements[i] ) {
6094
+ cloneFixAttributes( srcElements[i], destElements[i] );
6095
+ }
6052
6096
  }
6053
6097
  }
6054
6098
 
@@ -6248,14 +6292,14 @@ function evalScript( i, elem ) {
6248
6292
 
6249
6293
 
6250
6294
 
6295
+
6251
6296
  var ralpha = /alpha\([^)]*\)/i,
6252
6297
  ropacity = /opacity=([^)]*)/,
6253
6298
  // fixed for IE9, see #8346
6254
6299
  rupper = /([A-Z]|^ms)/g,
6255
6300
  rnumpx = /^-?\d+(?:px)?$/i,
6256
6301
  rnum = /^-?\d/,
6257
- rrelNum = /^[+\-]=/,
6258
- rrelNumFilter = /[^+\-\.\de]+/g,
6302
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
6259
6303
 
6260
6304
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6261
6305
  cssWidth = [ "Left", "Right" ],
@@ -6332,18 +6376,18 @@ jQuery.extend({
6332
6376
  if ( value !== undefined ) {
6333
6377
  type = typeof value;
6334
6378
 
6335
- // Make sure that NaN and null values aren't set. See: #7116
6336
- if ( type === "number" && isNaN( value ) || value == null ) {
6337
- return;
6338
- }
6339
-
6340
6379
  // convert relative number strings (+= or -=) to relative numbers. #7345
6341
- if ( type === "string" && rrelNum.test( value ) ) {
6342
- value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
6380
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6381
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
6343
6382
  // Fixes bug #9237
6344
6383
  type = "number";
6345
6384
  }
6346
6385
 
6386
+ // Make sure that NaN and null values aren't set. See: #7116
6387
+ if ( value == null || type === "number" && isNaN( value ) ) {
6388
+ return;
6389
+ }
6390
+
6347
6391
  // If a number was passed in, add 'px' to the (except for certain CSS properties)
6348
6392
  if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6349
6393
  value += "px";
@@ -6459,18 +6503,29 @@ if ( !jQuery.support.opacity ) {
6459
6503
 
6460
6504
  set: function( elem, value ) {
6461
6505
  var style = elem.style,
6462
- currentStyle = elem.currentStyle;
6506
+ currentStyle = elem.currentStyle,
6507
+ opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
6508
+ filter = currentStyle && currentStyle.filter || style.filter || "";
6463
6509
 
6464
6510
  // IE has trouble with opacity if it does not have layout
6465
6511
  // Force it by setting the zoom level
6466
6512
  style.zoom = 1;
6467
6513
 
6468
- // Set the alpha filter to set the opacity
6469
- var opacity = jQuery.isNaN( value ) ?
6470
- "" :
6471
- "alpha(opacity=" + value * 100 + ")",
6472
- filter = currentStyle && currentStyle.filter || style.filter || "";
6514
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6515
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
6516
+
6517
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6518
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
6519
+ // style.removeAttribute is IE Only, but so apparently is this code path...
6520
+ style.removeAttribute( "filter" );
6473
6521
 
6522
+ // if there there is no filter style applied in a css rule, we are done
6523
+ if ( currentStyle && !currentStyle.filter ) {
6524
+ return;
6525
+ }
6526
+ }
6527
+
6528
+ // otherwise, set new filter values
6474
6529
  style.filter = ralpha.test( filter ) ?
6475
6530
  filter.replace( ralpha, opacity ) :
6476
6531
  filter + " " + opacity;
@@ -6625,9 +6680,9 @@ var r20 = /%20/g,
6625
6680
  rCRLF = /\r?\n/g,
6626
6681
  rhash = /#.*$/,
6627
6682
  rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6628
- rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6683
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6629
6684
  // #7653, #8125, #8152: local protocol detection
6630
- rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
6685
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
6631
6686
  rnoContent = /^(?:GET|HEAD)$/,
6632
6687
  rprotocol = /^\/\//,
6633
6688
  rquery = /\?/,
@@ -6662,7 +6717,10 @@ var r20 = /%20/g,
6662
6717
  ajaxLocation,
6663
6718
 
6664
6719
  // Document location segments
6665
- ajaxLocParts;
6720
+ ajaxLocParts,
6721
+
6722
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
6723
+ allTypes = ["*/"] + ["*"];
6666
6724
 
6667
6725
  // #8138, IE may throw an exception when accessing
6668
6726
  // a field from window.location if document.domain has been set
@@ -6755,6 +6813,22 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
6755
6813
  return selection;
6756
6814
  }
6757
6815
 
6816
+ // A special extend for ajax options
6817
+ // that takes "flat" options (not to be deep extended)
6818
+ // Fixes #9887
6819
+ function ajaxExtend( target, src ) {
6820
+ var key, deep,
6821
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
6822
+ for( key in src ) {
6823
+ if ( src[ key ] !== undefined ) {
6824
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
6825
+ }
6826
+ }
6827
+ if ( deep ) {
6828
+ jQuery.extend( true, target, deep );
6829
+ }
6830
+ }
6831
+
6758
6832
  jQuery.fn.extend({
6759
6833
  load: function( url, params, callback ) {
6760
6834
  if ( typeof url !== "string" && _load ) {
@@ -6898,23 +6972,16 @@ jQuery.extend({
6898
6972
  // Creates a full fledged settings object into target
6899
6973
  // with both ajaxSettings and settings fields.
6900
6974
  // If target is omitted, writes into ajaxSettings.
6901
- ajaxSetup: function ( target, settings ) {
6902
- if ( !settings ) {
6903
- // Only one parameter, we extend ajaxSettings
6904
- settings = target;
6905
- target = jQuery.extend( true, jQuery.ajaxSettings, settings );
6975
+ ajaxSetup: function( target, settings ) {
6976
+ if ( settings ) {
6977
+ // Building a settings object
6978
+ ajaxExtend( target, jQuery.ajaxSettings );
6906
6979
  } else {
6907
- // target was provided, we extend into it
6908
- jQuery.extend( true, target, jQuery.ajaxSettings, settings );
6909
- }
6910
- // Flatten fields we don't want deep extended
6911
- for( var field in { context: 1, url: 1 } ) {
6912
- if ( field in settings ) {
6913
- target[ field ] = settings[ field ];
6914
- } else if( field in jQuery.ajaxSettings ) {
6915
- target[ field ] = jQuery.ajaxSettings[ field ];
6916
- }
6980
+ // Extending ajaxSettings
6981
+ settings = target;
6982
+ target = jQuery.ajaxSettings;
6917
6983
  }
6984
+ ajaxExtend( target, settings );
6918
6985
  return target;
6919
6986
  },
6920
6987
 
@@ -6942,7 +7009,7 @@ jQuery.extend({
6942
7009
  html: "text/html",
6943
7010
  text: "text/plain",
6944
7011
  json: "application/json, text/javascript",
6945
- "*": "*/*"
7012
+ "*": allTypes
6946
7013
  },
6947
7014
 
6948
7015
  contents: {
@@ -6972,6 +7039,15 @@ jQuery.extend({
6972
7039
 
6973
7040
  // Parse text as xml
6974
7041
  "text xml": jQuery.parseXML
7042
+ },
7043
+
7044
+ // For options that shouldn't be deep extended:
7045
+ // you can add your own custom options here if
7046
+ // and when you create one that shouldn't be
7047
+ // deep extended (see ajaxExtend)
7048
+ flatOptions: {
7049
+ context: true,
7050
+ url: true
6975
7051
  }
6976
7052
  },
6977
7053
 
@@ -7082,7 +7158,7 @@ jQuery.extend({
7082
7158
  // Callback for when everything is done
7083
7159
  // It is defined here because jslint complains if it is declared
7084
7160
  // at the end of the function (which would be more logical and readable)
7085
- function done( status, statusText, responses, headers ) {
7161
+ function done( status, nativeStatusText, responses, headers ) {
7086
7162
 
7087
7163
  // Called once
7088
7164
  if ( state === 2 ) {
@@ -7105,11 +7181,12 @@ jQuery.extend({
7105
7181
  responseHeadersString = headers || "";
7106
7182
 
7107
7183
  // Set readyState
7108
- jqXHR.readyState = status ? 4 : 0;
7184
+ jqXHR.readyState = status > 0 ? 4 : 0;
7109
7185
 
7110
7186
  var isSuccess,
7111
7187
  success,
7112
7188
  error,
7189
+ statusText = nativeStatusText,
7113
7190
  response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
7114
7191
  lastModified,
7115
7192
  etag;
@@ -7161,7 +7238,7 @@ jQuery.extend({
7161
7238
 
7162
7239
  // Set data for the fake xhr object
7163
7240
  jqXHR.status = status;
7164
- jqXHR.statusText = statusText;
7241
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
7165
7242
 
7166
7243
  // Success/Error
7167
7244
  if ( isSuccess ) {
@@ -7183,7 +7260,7 @@ jQuery.extend({
7183
7260
  completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
7184
7261
 
7185
7262
  if ( fireGlobals ) {
7186
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
7263
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
7187
7264
  // Handle the global AJAX counter
7188
7265
  if ( !( --jQuery.active ) ) {
7189
7266
  jQuery.event.trigger( "ajaxStop" );
@@ -7264,6 +7341,8 @@ jQuery.extend({
7264
7341
  // If data is available, append data to url
7265
7342
  if ( s.data ) {
7266
7343
  s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
7344
+ // #9682: remove data so that it's not used in an eventual retry
7345
+ delete s.data;
7267
7346
  }
7268
7347
 
7269
7348
  // Get ifModifiedKey before adding the anti-cache parameter
@@ -7301,7 +7380,7 @@ jQuery.extend({
7301
7380
  jqXHR.setRequestHeader(
7302
7381
  "Accept",
7303
7382
  s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7304
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
7383
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
7305
7384
  s.accepts[ "*" ]
7306
7385
  );
7307
7386
 
@@ -7347,7 +7426,7 @@ jQuery.extend({
7347
7426
  transport.send( requestHeaders, done );
7348
7427
  } catch (e) {
7349
7428
  // Propagate exception as error if not done
7350
- if ( status < 2 ) {
7429
+ if ( state < 2 ) {
7351
7430
  done( -1, e );
7352
7431
  // Simply rethrow otherwise
7353
7432
  } else {
@@ -7995,10 +8074,7 @@ var elemdisplay = {},
7995
8074
  // opacity animations
7996
8075
  [ "opacity" ]
7997
8076
  ],
7998
- fxNow,
7999
- requestAnimationFrame = window.webkitRequestAnimationFrame ||
8000
- window.mozRequestAnimationFrame ||
8001
- window.oRequestAnimationFrame;
8077
+ fxNow;
8002
8078
 
8003
8079
  jQuery.fn.extend({
8004
8080
  show: function( speed, easing, callback ) {
@@ -8374,8 +8450,7 @@ jQuery.fx.prototype = {
8374
8450
  // Start an animation from one number to another
8375
8451
  custom: function( from, to, unit ) {
8376
8452
  var self = this,
8377
- fx = jQuery.fx,
8378
- raf;
8453
+ fx = jQuery.fx;
8379
8454
 
8380
8455
  this.startTime = fxNow || createFxNow();
8381
8456
  this.start = from;
@@ -8391,20 +8466,7 @@ jQuery.fx.prototype = {
8391
8466
  t.elem = this.elem;
8392
8467
 
8393
8468
  if ( t() && jQuery.timers.push(t) && !timerId ) {
8394
- // Use requestAnimationFrame instead of setInterval if available
8395
- if ( requestAnimationFrame ) {
8396
- timerId = true;
8397
- raf = function() {
8398
- // When timerId gets set to null at any point, this stops
8399
- if ( timerId ) {
8400
- requestAnimationFrame( raf );
8401
- fx.tick();
8402
- }
8403
- };
8404
- requestAnimationFrame( raf );
8405
- } else {
8406
- timerId = setInterval( fx.tick, fx.interval );
8407
- }
8469
+ timerId = setInterval( fx.tick, fx.interval );
8408
8470
  }
8409
8471
  },
8410
8472
 
@@ -8947,9 +9009,10 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
8947
9009
  if ( jQuery.isWindow( elem ) ) {
8948
9010
  // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
8949
9011
  // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
8950
- var docElemProp = elem.document.documentElement[ "client" + name ];
9012
+ var docElemProp = elem.document.documentElement[ "client" + name ],
9013
+ body = elem.document.body;
8951
9014
  return elem.document.compatMode === "CSS1Compat" && docElemProp ||
8952
- elem.document.body[ "client" + name ] || docElemProp;
9015
+ body && body[ "client" + name ] || docElemProp;
8953
9016
 
8954
9017
  // Get document width or height
8955
9018
  } else if ( elem.nodeType === 9 ) {
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jquery-source
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.6.2
5
+ version: 1.6.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel X. Moore