jquery-rails 4.4.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
1
  /*!
2
- * jQuery JavaScript Library v3.5.1
2
+ * jQuery JavaScript Library v3.6.1
3
3
  * https://jquery.com/
4
4
  *
5
5
  * Includes Sizzle.js
6
6
  * https://sizzlejs.com/
7
7
  *
8
- * Copyright JS Foundation and other contributors
8
+ * Copyright OpenJS Foundation and other contributors
9
9
  * Released under the MIT license
10
10
  * https://jquery.org/license
11
11
  *
12
- * Date: 2020-05-04T22:49Z
12
+ * Date: 2022-08-26T17:52Z
13
13
  */
14
14
  ( function( global, factory ) {
15
15
 
@@ -23,7 +23,7 @@
23
23
  // (such as Node.js), expose a factory as module.exports.
24
24
  // This accentuates the need for the creation of a real `window`.
25
25
  // e.g. var jQuery = require("jquery")(window);
26
- // See ticket #14549 for more info.
26
+ // See ticket trac-14549 for more info.
27
27
  module.exports = global.document ?
28
28
  factory( global, true ) :
29
29
  function( w ) {
@@ -76,12 +76,16 @@ var support = {};
76
76
 
77
77
  var isFunction = function isFunction( obj ) {
78
78
 
79
- // Support: Chrome <=57, Firefox <=52
80
- // In some browsers, typeof returns "function" for HTML <object> elements
81
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
82
- // We don't want to classify *any* DOM node as a function.
83
- return typeof obj === "function" && typeof obj.nodeType !== "number";
84
- };
79
+ // Support: Chrome <=57, Firefox <=52
80
+ // In some browsers, typeof returns "function" for HTML <object> elements
81
+ // (i.e., `typeof document.createElement( "object" ) === "function"`).
82
+ // We don't want to classify *any* DOM node as a function.
83
+ // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
84
+ // Plus for old WebKit, typeof returns "function" for HTML collections
85
+ // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
86
+ return typeof obj === "function" && typeof obj.nodeType !== "number" &&
87
+ typeof obj.item !== "function";
88
+ };
85
89
 
86
90
 
87
91
  var isWindow = function isWindow( obj ) {
@@ -147,7 +151,7 @@ function toType( obj ) {
147
151
 
148
152
 
149
153
  var
150
- version = "3.5.1",
154
+ version = "3.6.1",
151
155
 
152
156
  // Define a local copy of jQuery
153
157
  jQuery = function( selector, context ) {
@@ -401,7 +405,7 @@ jQuery.extend( {
401
405
  if ( isArrayLike( Object( arr ) ) ) {
402
406
  jQuery.merge( ret,
403
407
  typeof arr === "string" ?
404
- [ arr ] : arr
408
+ [ arr ] : arr
405
409
  );
406
410
  } else {
407
411
  push.call( ret, arr );
@@ -496,9 +500,9 @@ if ( typeof Symbol === "function" ) {
496
500
 
497
501
  // Populate the class2type map
498
502
  jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
499
- function( _i, name ) {
500
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
501
- } );
503
+ function( _i, name ) {
504
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
505
+ } );
502
506
 
503
507
  function isArrayLike( obj ) {
504
508
 
@@ -518,14 +522,14 @@ function isArrayLike( obj ) {
518
522
  }
519
523
  var Sizzle =
520
524
  /*!
521
- * Sizzle CSS Selector Engine v2.3.5
525
+ * Sizzle CSS Selector Engine v2.3.6
522
526
  * https://sizzlejs.com/
523
527
  *
524
528
  * Copyright JS Foundation and other contributors
525
529
  * Released under the MIT license
526
530
  * https://js.foundation/
527
531
  *
528
- * Date: 2020-03-14
532
+ * Date: 2021-02-16
529
533
  */
530
534
  ( function( window ) {
531
535
  var i,
@@ -1108,8 +1112,8 @@ support = Sizzle.support = {};
1108
1112
  * @returns {Boolean} True iff elem is a non-HTML XML node
1109
1113
  */
1110
1114
  isXML = Sizzle.isXML = function( elem ) {
1111
- var namespace = elem.namespaceURI,
1112
- docElem = ( elem.ownerDocument || elem ).documentElement;
1115
+ var namespace = elem && elem.namespaceURI,
1116
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;
1113
1117
 
1114
1118
  // Support: IE <=8
1115
1119
  // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
@@ -3024,9 +3028,9 @@ var rneedsContext = jQuery.expr.match.needsContext;
3024
3028
 
3025
3029
  function nodeName( elem, name ) {
3026
3030
 
3027
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3031
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3028
3032
 
3029
- };
3033
+ }
3030
3034
  var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
3031
3035
 
3032
3036
 
@@ -3125,8 +3129,8 @@ jQuery.fn.extend( {
3125
3129
  var rootjQuery,
3126
3130
 
3127
3131
  // A simple way to check for HTML strings
3128
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
3129
- // Strict HTML recognition (#11290: must start with <)
3132
+ // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
3133
+ // Strict HTML recognition (trac-11290: must start with <)
3130
3134
  // Shortcut simple #id case for speed
3131
3135
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3132
3136
 
@@ -3997,8 +4001,8 @@ jQuery.extend( {
3997
4001
  resolveContexts = Array( i ),
3998
4002
  resolveValues = slice.call( arguments ),
3999
4003
 
4000
- // the master Deferred
4001
- master = jQuery.Deferred(),
4004
+ // the primary Deferred
4005
+ primary = jQuery.Deferred(),
4002
4006
 
4003
4007
  // subordinate callback factory
4004
4008
  updateFunc = function( i ) {
@@ -4006,30 +4010,30 @@ jQuery.extend( {
4006
4010
  resolveContexts[ i ] = this;
4007
4011
  resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
4008
4012
  if ( !( --remaining ) ) {
4009
- master.resolveWith( resolveContexts, resolveValues );
4013
+ primary.resolveWith( resolveContexts, resolveValues );
4010
4014
  }
4011
4015
  };
4012
4016
  };
4013
4017
 
4014
4018
  // Single- and empty arguments are adopted like Promise.resolve
4015
4019
  if ( remaining <= 1 ) {
4016
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
4020
+ adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
4017
4021
  !remaining );
4018
4022
 
4019
4023
  // Use .then() to unwrap secondary thenables (cf. gh-3000)
4020
- if ( master.state() === "pending" ||
4024
+ if ( primary.state() === "pending" ||
4021
4025
  isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
4022
4026
 
4023
- return master.then();
4027
+ return primary.then();
4024
4028
  }
4025
4029
  }
4026
4030
 
4027
4031
  // Multiple arguments are aggregated like Promise.all array elements
4028
4032
  while ( i-- ) {
4029
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
4033
+ adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
4030
4034
  }
4031
4035
 
4032
- return master.promise();
4036
+ return primary.promise();
4033
4037
  }
4034
4038
  } );
4035
4039
 
@@ -4083,7 +4087,7 @@ jQuery.extend( {
4083
4087
  isReady: false,
4084
4088
 
4085
4089
  // A counter to track how many items to wait for before
4086
- // the ready event fires. See #6781
4090
+ // the ready event fires. See trac-6781
4087
4091
  readyWait: 1,
4088
4092
 
4089
4093
  // Handle when the DOM is ready
@@ -4180,8 +4184,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4180
4184
  for ( ; i < len; i++ ) {
4181
4185
  fn(
4182
4186
  elems[ i ], key, raw ?
4183
- value :
4184
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
4187
+ value :
4188
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
4185
4189
  );
4186
4190
  }
4187
4191
  }
@@ -4211,7 +4215,7 @@ function fcamelCase( _all, letter ) {
4211
4215
 
4212
4216
  // Convert dashed to camelCase; used by the css and data modules
4213
4217
  // Support: IE <=9 - 11, Edge 12 - 15
4214
- // Microsoft forgot to hump their vendor prefix (#9572)
4218
+ // Microsoft forgot to hump their vendor prefix (trac-9572)
4215
4219
  function camelCase( string ) {
4216
4220
  return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4217
4221
  }
@@ -4247,7 +4251,7 @@ Data.prototype = {
4247
4251
  value = {};
4248
4252
 
4249
4253
  // We can accept data for non-element nodes in modern browsers,
4250
- // but we should not, see #8335.
4254
+ // but we should not, see trac-8335.
4251
4255
  // Always return an empty object.
4252
4256
  if ( acceptData( owner ) ) {
4253
4257
 
@@ -4486,7 +4490,7 @@ jQuery.fn.extend( {
4486
4490
  while ( i-- ) {
4487
4491
 
4488
4492
  // Support: IE 11 only
4489
- // The attrs elements can be null (#14894)
4493
+ // The attrs elements can be null (trac-14894)
4490
4494
  if ( attrs[ i ] ) {
4491
4495
  name = attrs[ i ].name;
4492
4496
  if ( name.indexOf( "data-" ) === 0 ) {
@@ -4909,9 +4913,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4909
4913
  input = document.createElement( "input" );
4910
4914
 
4911
4915
  // Support: Android 4.0 - 4.3 only
4912
- // Check state lost if the name is set (#11217)
4916
+ // Check state lost if the name is set (trac-11217)
4913
4917
  // Support: Windows Web Apps (WWA)
4914
- // `name` and `type` must use .setAttribute for WWA (#14901)
4918
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
4915
4919
  input.setAttribute( "type", "radio" );
4916
4920
  input.setAttribute( "checked", "checked" );
4917
4921
  input.setAttribute( "name", "t" );
@@ -4935,7 +4939,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4935
4939
  } )();
4936
4940
 
4937
4941
 
4938
- // We have to close these tags to support XHTML (#13200)
4942
+ // We have to close these tags to support XHTML (trac-13200)
4939
4943
  var wrapMap = {
4940
4944
 
4941
4945
  // XHTML parsers do not magically insert elements in the
@@ -4961,7 +4965,7 @@ if ( !support.option ) {
4961
4965
  function getAll( context, tag ) {
4962
4966
 
4963
4967
  // Support: IE <=9 - 11 only
4964
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4968
+ // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
4965
4969
  var ret;
4966
4970
 
4967
4971
  if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -5044,7 +5048,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5044
5048
  // Remember the top-level container
5045
5049
  tmp = fragment.firstChild;
5046
5050
 
5047
- // Ensure the created nodes are orphaned (#12392)
5051
+ // Ensure the created nodes are orphaned (trac-12392)
5048
5052
  tmp.textContent = "";
5049
5053
  }
5050
5054
  }
@@ -5089,10 +5093,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5089
5093
  }
5090
5094
 
5091
5095
 
5092
- var
5093
- rkeyEvent = /^key/,
5094
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
5095
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5096
+ var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5096
5097
 
5097
5098
  function returnTrue() {
5098
5099
  return true;
@@ -5387,8 +5388,8 @@ jQuery.event = {
5387
5388
  event = jQuery.event.fix( nativeEvent ),
5388
5389
 
5389
5390
  handlers = (
5390
- dataPriv.get( this, "events" ) || Object.create( null )
5391
- )[ event.type ] || [],
5391
+ dataPriv.get( this, "events" ) || Object.create( null )
5392
+ )[ event.type ] || [],
5392
5393
  special = jQuery.event.special[ event.type ] || {};
5393
5394
 
5394
5395
  // Use the fix-ed jQuery.Event rather than the (read-only) native event
@@ -5468,15 +5469,15 @@ jQuery.event = {
5468
5469
 
5469
5470
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5470
5471
 
5471
- // Don't check non-elements (#13208)
5472
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5472
+ // Don't check non-elements (trac-13208)
5473
+ // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
5473
5474
  if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5474
5475
  matchedHandlers = [];
5475
5476
  matchedSelectors = {};
5476
5477
  for ( i = 0; i < delegateCount; i++ ) {
5477
5478
  handleObj = handlers[ i ];
5478
5479
 
5479
- // Don't conflict with Object.prototype properties (#13203)
5480
+ // Don't conflict with Object.prototype properties (trac-13203)
5480
5481
  sel = handleObj.selector + " ";
5481
5482
 
5482
5483
  if ( matchedSelectors[ sel ] === undefined ) {
@@ -5512,12 +5513,12 @@ jQuery.event = {
5512
5513
  get: isFunction( hook ) ?
5513
5514
  function() {
5514
5515
  if ( this.originalEvent ) {
5515
- return hook( this.originalEvent );
5516
+ return hook( this.originalEvent );
5516
5517
  }
5517
5518
  } :
5518
5519
  function() {
5519
5520
  if ( this.originalEvent ) {
5520
- return this.originalEvent[ name ];
5521
+ return this.originalEvent[ name ];
5521
5522
  }
5522
5523
  },
5523
5524
 
@@ -5656,7 +5657,13 @@ function leverageNative( el, type, expectSync ) {
5656
5657
  // Cancel the outer synthetic event
5657
5658
  event.stopImmediatePropagation();
5658
5659
  event.preventDefault();
5659
- return result.value;
5660
+
5661
+ // Support: Chrome 86+
5662
+ // In Chrome, if an element having a focusout handler is blurred by
5663
+ // clicking outside of it, it invokes the handler synchronously. If
5664
+ // that handler calls `.remove()` on the element, the data is cleared,
5665
+ // leaving `result` undefined. We need to guard against this.
5666
+ return result && result.value;
5660
5667
  }
5661
5668
 
5662
5669
  // If this is an inner synthetic event for an event with a bubbling surrogate
@@ -5724,7 +5731,7 @@ jQuery.Event = function( src, props ) {
5724
5731
 
5725
5732
  // Create target properties
5726
5733
  // Support: Safari <=6 - 7 only
5727
- // Target should not be a text node (#504, #13143)
5734
+ // Target should not be a text node (trac-504, trac-13143)
5728
5735
  this.target = ( src.target && src.target.nodeType === 3 ) ?
5729
5736
  src.target.parentNode :
5730
5737
  src.target;
@@ -5821,34 +5828,7 @@ jQuery.each( {
5821
5828
  targetTouches: true,
5822
5829
  toElement: true,
5823
5830
  touches: true,
5824
-
5825
- which: function( event ) {
5826
- var button = event.button;
5827
-
5828
- // Add which for key events
5829
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
5830
- return event.charCode != null ? event.charCode : event.keyCode;
5831
- }
5832
-
5833
- // Add which for click: 1 === left; 2 === middle; 3 === right
5834
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5835
- if ( button & 1 ) {
5836
- return 1;
5837
- }
5838
-
5839
- if ( button & 2 ) {
5840
- return 3;
5841
- }
5842
-
5843
- if ( button & 4 ) {
5844
- return 2;
5845
- }
5846
-
5847
- return 0;
5848
- }
5849
-
5850
- return event.which;
5851
- }
5831
+ which: true
5852
5832
  }, jQuery.event.addProp );
5853
5833
 
5854
5834
  jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
@@ -5874,6 +5854,12 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
5874
5854
  return true;
5875
5855
  },
5876
5856
 
5857
+ // Suppress native focus or blur if we're currently inside
5858
+ // a leveraged native-event stack
5859
+ _default: function( event ) {
5860
+ return dataPriv.get( event.target, type );
5861
+ },
5862
+
5877
5863
  delegateType: delegateType
5878
5864
  };
5879
5865
  } );
@@ -5970,7 +5956,8 @@ var
5970
5956
 
5971
5957
  // checked="checked" or checked
5972
5958
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5973
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5959
+
5960
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5974
5961
 
5975
5962
  // Prefer a tbody over its parent table for containing new rows
5976
5963
  function manipulationTarget( elem, content ) {
@@ -6084,7 +6071,7 @@ function domManip( collection, args, callback, ignored ) {
6084
6071
 
6085
6072
  // Use the original fragment for the last item
6086
6073
  // instead of the first because it can end up
6087
- // being emptied incorrectly in certain situations (#8070).
6074
+ // being emptied incorrectly in certain situations (trac-8070).
6088
6075
  for ( ; i < l; i++ ) {
6089
6076
  node = fragment;
6090
6077
 
@@ -6125,6 +6112,12 @@ function domManip( collection, args, callback, ignored ) {
6125
6112
  }, doc );
6126
6113
  }
6127
6114
  } else {
6115
+
6116
+ // Unwrap a CDATA section containing script contents. This shouldn't be
6117
+ // needed as in XML documents they're already not visible when
6118
+ // inspecting element contents and in HTML documents they have no
6119
+ // meaning but we're preserving that logic for backwards compatibility.
6120
+ // This will be removed completely in 4.0. See gh-4904.
6128
6121
  DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6129
6122
  }
6130
6123
  }
@@ -6407,9 +6400,12 @@ jQuery.each( {
6407
6400
  } );
6408
6401
  var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6409
6402
 
6403
+ var rcustomProp = /^--/;
6404
+
6405
+
6410
6406
  var getStyles = function( elem ) {
6411
6407
 
6412
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6408
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6413
6409
  // IE throws on elements created in popups
6414
6410
  // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6415
6411
  var view = elem.ownerDocument.defaultView;
@@ -6444,6 +6440,15 @@ var swap = function( elem, options, callback ) {
6444
6440
 
6445
6441
  var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6446
6442
 
6443
+ var whitespace = "[\\x20\\t\\r\\n\\f]";
6444
+
6445
+
6446
+ var rtrimCSS = new RegExp(
6447
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6448
+ "g"
6449
+ );
6450
+
6451
+
6447
6452
 
6448
6453
 
6449
6454
  ( function() {
@@ -6509,7 +6514,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6509
6514
  }
6510
6515
 
6511
6516
  // Support: IE <=9 - 11 only
6512
- // Style of cloned element affects source element cloned (#8908)
6517
+ // Style of cloned element affects source element cloned (trac-8908)
6513
6518
  div.style.backgroundClip = "content-box";
6514
6519
  div.cloneNode( true ).style.backgroundClip = "";
6515
6520
  support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6541,6 +6546,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6541
6546
  // set in CSS while `offset*` properties report correct values.
6542
6547
  // Behavior in IE 9 is more subtle than in newer versions & it passes
6543
6548
  // some versions of this test; make sure not to make it pass there!
6549
+ //
6550
+ // Support: Firefox 70+
6551
+ // Only Firefox includes border widths
6552
+ // in computed dimensions. (gh-4529)
6544
6553
  reliableTrDimensions: function() {
6545
6554
  var table, tr, trChild, trStyle;
6546
6555
  if ( reliableTrDimensionsVal == null ) {
@@ -6548,17 +6557,32 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6548
6557
  tr = document.createElement( "tr" );
6549
6558
  trChild = document.createElement( "div" );
6550
6559
 
6551
- table.style.cssText = "position:absolute;left:-11111px";
6560
+ table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
6561
+ tr.style.cssText = "border:1px solid";
6562
+
6563
+ // Support: Chrome 86+
6564
+ // Height set through cssText does not get applied.
6565
+ // Computed height then comes back as 0.
6552
6566
  tr.style.height = "1px";
6553
6567
  trChild.style.height = "9px";
6554
6568
 
6569
+ // Support: Android 8 Chrome 86+
6570
+ // In our bodyBackground.html iframe,
6571
+ // display for all div elements is set to "inline",
6572
+ // which causes a problem only in Android 8 Chrome 86.
6573
+ // Ensuring the div is display: block
6574
+ // gets around this issue.
6575
+ trChild.style.display = "block";
6576
+
6555
6577
  documentElement
6556
6578
  .appendChild( table )
6557
6579
  .appendChild( tr )
6558
6580
  .appendChild( trChild );
6559
6581
 
6560
6582
  trStyle = window.getComputedStyle( tr );
6561
- reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
6583
+ reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
6584
+ parseInt( trStyle.borderTopWidth, 10 ) +
6585
+ parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
6562
6586
 
6563
6587
  documentElement.removeChild( table );
6564
6588
  }
@@ -6570,6 +6594,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6570
6594
 
6571
6595
  function curCSS( elem, name, computed ) {
6572
6596
  var width, minWidth, maxWidth, ret,
6597
+ isCustomProp = rcustomProp.test( name ),
6573
6598
 
6574
6599
  // Support: Firefox 51+
6575
6600
  // Retrieving style before computed somehow
@@ -6580,11 +6605,22 @@ function curCSS( elem, name, computed ) {
6580
6605
  computed = computed || getStyles( elem );
6581
6606
 
6582
6607
  // getPropertyValue is needed for:
6583
- // .css('filter') (IE 9 only, #12537)
6584
- // .css('--customProperty) (#3144)
6608
+ // .css('filter') (IE 9 only, trac-12537)
6609
+ // .css('--customProperty) (gh-3144)
6585
6610
  if ( computed ) {
6586
6611
  ret = computed.getPropertyValue( name ) || computed[ name ];
6587
6612
 
6613
+ // trim whitespace for custom property (issue gh-4926)
6614
+ if ( isCustomProp ) {
6615
+
6616
+ // rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
6617
+ // as whitespace while CSS does not, but this is not a problem
6618
+ // because CSS preprocessing replaces them with U+000A LINE FEED
6619
+ // (which *is* CSS whitespace)
6620
+ // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
6621
+ ret = ret.replace( rtrimCSS, "$1" );
6622
+ }
6623
+
6588
6624
  if ( ret === "" && !isAttached( elem ) ) {
6589
6625
  ret = jQuery.style( elem, name );
6590
6626
  }
@@ -6680,7 +6716,6 @@ var
6680
6716
  // except "table", "table-cell", or "table-caption"
6681
6717
  // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6682
6718
  rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6683
- rcustomProp = /^--/,
6684
6719
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6685
6720
  cssNormalTransform = {
6686
6721
  letterSpacing: "0",
@@ -6916,15 +6951,15 @@ jQuery.extend( {
6916
6951
  if ( value !== undefined ) {
6917
6952
  type = typeof value;
6918
6953
 
6919
- // Convert "+=" or "-=" to relative numbers (#7345)
6954
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
6920
6955
  if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6921
6956
  value = adjustCSS( elem, name, ret );
6922
6957
 
6923
- // Fixes bug #9237
6958
+ // Fixes bug trac-9237
6924
6959
  type = "number";
6925
6960
  }
6926
6961
 
6927
- // Make sure that null and NaN values aren't set (#7116)
6962
+ // Make sure that null and NaN values aren't set (trac-7116)
6928
6963
  if ( value == null || value !== value ) {
6929
6964
  return;
6930
6965
  }
@@ -7022,10 +7057,10 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
7022
7057
  // Running getBoundingClientRect on a disconnected node
7023
7058
  // in IE throws an error.
7024
7059
  ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
7025
- swap( elem, cssShow, function() {
7026
- return getWidthOrHeight( elem, dimension, extra );
7027
- } ) :
7028
- getWidthOrHeight( elem, dimension, extra );
7060
+ swap( elem, cssShow, function() {
7061
+ return getWidthOrHeight( elem, dimension, extra );
7062
+ } ) :
7063
+ getWidthOrHeight( elem, dimension, extra );
7029
7064
  }
7030
7065
  },
7031
7066
 
@@ -7084,7 +7119,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
7084
7119
  swap( elem, { marginLeft: 0 }, function() {
7085
7120
  return elem.getBoundingClientRect().left;
7086
7121
  } )
7087
- ) + "px";
7122
+ ) + "px";
7088
7123
  }
7089
7124
  }
7090
7125
  );
@@ -7223,7 +7258,7 @@ Tween.propHooks = {
7223
7258
  if ( jQuery.fx.step[ tween.prop ] ) {
7224
7259
  jQuery.fx.step[ tween.prop ]( tween );
7225
7260
  } else if ( tween.elem.nodeType === 1 && (
7226
- jQuery.cssHooks[ tween.prop ] ||
7261
+ jQuery.cssHooks[ tween.prop ] ||
7227
7262
  tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
7228
7263
  jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7229
7264
  } else {
@@ -7468,7 +7503,7 @@ function defaultPrefilter( elem, props, opts ) {
7468
7503
 
7469
7504
  anim.done( function() {
7470
7505
 
7471
- /* eslint-enable no-loop-func */
7506
+ /* eslint-enable no-loop-func */
7472
7507
 
7473
7508
  // The final step of a "hide" animation is actually hiding the element
7474
7509
  if ( !hidden ) {
@@ -7548,7 +7583,7 @@ function Animation( elem, properties, options ) {
7548
7583
  remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7549
7584
 
7550
7585
  // Support: Android 2.3 only
7551
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7586
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
7552
7587
  temp = remaining / animation.duration || 0,
7553
7588
  percent = 1 - temp,
7554
7589
  index = 0,
@@ -7588,7 +7623,7 @@ function Animation( elem, properties, options ) {
7588
7623
  tweens: [],
7589
7624
  createTween: function( prop, end ) {
7590
7625
  var tween = jQuery.Tween( elem, animation.opts, prop, end,
7591
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
7626
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
7592
7627
  animation.tweens.push( tween );
7593
7628
  return tween;
7594
7629
  },
@@ -7761,7 +7796,8 @@ jQuery.fn.extend( {
7761
7796
  anim.stop( true );
7762
7797
  }
7763
7798
  };
7764
- doAnimation.finish = doAnimation;
7799
+
7800
+ doAnimation.finish = doAnimation;
7765
7801
 
7766
7802
  return empty || optall.queue === false ?
7767
7803
  this.each( doAnimation ) :
@@ -7937,7 +7973,6 @@ jQuery.fx.speeds = {
7937
7973
 
7938
7974
 
7939
7975
  // Based off of the plugin by Clint Helfers, with permission.
7940
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7941
7976
  jQuery.fn.delay = function( time, type ) {
7942
7977
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7943
7978
  type = type || "fx";
@@ -8162,8 +8197,7 @@ jQuery.extend( {
8162
8197
  // Support: IE <=9 - 11 only
8163
8198
  // elem.tabIndex doesn't always return the
8164
8199
  // correct value when it hasn't been explicitly set
8165
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8166
- // Use proper attribute retrieval(#12072)
8200
+ // Use proper attribute retrieval (trac-12072)
8167
8201
  var tabindex = jQuery.find.attr( elem, "tabindex" );
8168
8202
 
8169
8203
  if ( tabindex ) {
@@ -8267,8 +8301,7 @@ function classesToArray( value ) {
8267
8301
 
8268
8302
  jQuery.fn.extend( {
8269
8303
  addClass: function( value ) {
8270
- var classes, elem, cur, curValue, clazz, j, finalValue,
8271
- i = 0;
8304
+ var classNames, cur, curValue, className, i, finalValue;
8272
8305
 
8273
8306
  if ( isFunction( value ) ) {
8274
8307
  return this.each( function( j ) {
@@ -8276,36 +8309,35 @@ jQuery.fn.extend( {
8276
8309
  } );
8277
8310
  }
8278
8311
 
8279
- classes = classesToArray( value );
8312
+ classNames = classesToArray( value );
8280
8313
 
8281
- if ( classes.length ) {
8282
- while ( ( elem = this[ i++ ] ) ) {
8283
- curValue = getClass( elem );
8284
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8314
+ if ( classNames.length ) {
8315
+ return this.each( function() {
8316
+ curValue = getClass( this );
8317
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8285
8318
 
8286
8319
  if ( cur ) {
8287
- j = 0;
8288
- while ( ( clazz = classes[ j++ ] ) ) {
8289
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8290
- cur += clazz + " ";
8320
+ for ( i = 0; i < classNames.length; i++ ) {
8321
+ className = classNames[ i ];
8322
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
8323
+ cur += className + " ";
8291
8324
  }
8292
8325
  }
8293
8326
 
8294
8327
  // Only assign if different to avoid unneeded rendering.
8295
8328
  finalValue = stripAndCollapse( cur );
8296
8329
  if ( curValue !== finalValue ) {
8297
- elem.setAttribute( "class", finalValue );
8330
+ this.setAttribute( "class", finalValue );
8298
8331
  }
8299
8332
  }
8300
- }
8333
+ } );
8301
8334
  }
8302
8335
 
8303
8336
  return this;
8304
8337
  },
8305
8338
 
8306
8339
  removeClass: function( value ) {
8307
- var classes, elem, cur, curValue, clazz, j, finalValue,
8308
- i = 0;
8340
+ var classNames, cur, curValue, className, i, finalValue;
8309
8341
 
8310
8342
  if ( isFunction( value ) ) {
8311
8343
  return this.each( function( j ) {
@@ -8317,45 +8349,42 @@ jQuery.fn.extend( {
8317
8349
  return this.attr( "class", "" );
8318
8350
  }
8319
8351
 
8320
- classes = classesToArray( value );
8352
+ classNames = classesToArray( value );
8321
8353
 
8322
- if ( classes.length ) {
8323
- while ( ( elem = this[ i++ ] ) ) {
8324
- curValue = getClass( elem );
8354
+ if ( classNames.length ) {
8355
+ return this.each( function() {
8356
+ curValue = getClass( this );
8325
8357
 
8326
8358
  // This expression is here for better compressibility (see addClass)
8327
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8359
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8328
8360
 
8329
8361
  if ( cur ) {
8330
- j = 0;
8331
- while ( ( clazz = classes[ j++ ] ) ) {
8362
+ for ( i = 0; i < classNames.length; i++ ) {
8363
+ className = classNames[ i ];
8332
8364
 
8333
8365
  // Remove *all* instances
8334
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8335
- cur = cur.replace( " " + clazz + " ", " " );
8366
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
8367
+ cur = cur.replace( " " + className + " ", " " );
8336
8368
  }
8337
8369
  }
8338
8370
 
8339
8371
  // Only assign if different to avoid unneeded rendering.
8340
8372
  finalValue = stripAndCollapse( cur );
8341
8373
  if ( curValue !== finalValue ) {
8342
- elem.setAttribute( "class", finalValue );
8374
+ this.setAttribute( "class", finalValue );
8343
8375
  }
8344
8376
  }
8345
- }
8377
+ } );
8346
8378
  }
8347
8379
 
8348
8380
  return this;
8349
8381
  },
8350
8382
 
8351
8383
  toggleClass: function( value, stateVal ) {
8352
- var type = typeof value,
8384
+ var classNames, className, i, self,
8385
+ type = typeof value,
8353
8386
  isValidValue = type === "string" || Array.isArray( value );
8354
8387
 
8355
- if ( typeof stateVal === "boolean" && isValidValue ) {
8356
- return stateVal ? this.addClass( value ) : this.removeClass( value );
8357
- }
8358
-
8359
8388
  if ( isFunction( value ) ) {
8360
8389
  return this.each( function( i ) {
8361
8390
  jQuery( this ).toggleClass(
@@ -8365,17 +8394,20 @@ jQuery.fn.extend( {
8365
8394
  } );
8366
8395
  }
8367
8396
 
8368
- return this.each( function() {
8369
- var className, i, self, classNames;
8397
+ if ( typeof stateVal === "boolean" && isValidValue ) {
8398
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
8399
+ }
8370
8400
 
8401
+ classNames = classesToArray( value );
8402
+
8403
+ return this.each( function() {
8371
8404
  if ( isValidValue ) {
8372
8405
 
8373
8406
  // Toggle individual class names
8374
- i = 0;
8375
8407
  self = jQuery( this );
8376
- classNames = classesToArray( value );
8377
8408
 
8378
- while ( ( className = classNames[ i++ ] ) ) {
8409
+ for ( i = 0; i < classNames.length; i++ ) {
8410
+ className = classNames[ i ];
8379
8411
 
8380
8412
  // Check each className given, space separated list
8381
8413
  if ( self.hasClass( className ) ) {
@@ -8401,8 +8433,8 @@ jQuery.fn.extend( {
8401
8433
  if ( this.setAttribute ) {
8402
8434
  this.setAttribute( "class",
8403
8435
  className || value === false ?
8404
- "" :
8405
- dataPriv.get( this, "__className__" ) || ""
8436
+ "" :
8437
+ dataPriv.get( this, "__className__" ) || ""
8406
8438
  );
8407
8439
  }
8408
8440
  }
@@ -8417,7 +8449,7 @@ jQuery.fn.extend( {
8417
8449
  while ( ( elem = this[ i++ ] ) ) {
8418
8450
  if ( elem.nodeType === 1 &&
8419
8451
  ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
8420
- return true;
8452
+ return true;
8421
8453
  }
8422
8454
  }
8423
8455
 
@@ -8509,7 +8541,7 @@ jQuery.extend( {
8509
8541
  val :
8510
8542
 
8511
8543
  // Support: IE <=10 - 11 only
8512
- // option.text throws exceptions (#14686, #14858)
8544
+ // option.text throws exceptions (trac-14686, trac-14858)
8513
8545
  // Strip and collapse whitespace
8514
8546
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8515
8547
  stripAndCollapse( jQuery.text( elem ) );
@@ -8536,7 +8568,7 @@ jQuery.extend( {
8536
8568
  option = options[ i ];
8537
8569
 
8538
8570
  // Support: IE <=9 only
8539
- // IE8-9 doesn't update selected after form reset (#2551)
8571
+ // IE8-9 doesn't update selected after form reset (trac-2551)
8540
8572
  if ( ( option.selected || i === index ) &&
8541
8573
 
8542
8574
  // Don't return options that are disabled or in a disabled optgroup
@@ -8679,8 +8711,8 @@ jQuery.extend( jQuery.event, {
8679
8711
  return;
8680
8712
  }
8681
8713
 
8682
- // Determine event propagation path in advance, per W3C events spec (#9951)
8683
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8714
+ // Determine event propagation path in advance, per W3C events spec (trac-9951)
8715
+ // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
8684
8716
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8685
8717
 
8686
8718
  bubbleType = special.delegateType || type;
@@ -8707,9 +8739,7 @@ jQuery.extend( jQuery.event, {
8707
8739
  special.bindType || type;
8708
8740
 
8709
8741
  // jQuery handler
8710
- handle = (
8711
- dataPriv.get( cur, "events" ) || Object.create( null )
8712
- )[ event.type ] &&
8742
+ handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
8713
8743
  dataPriv.get( cur, "handle" );
8714
8744
  if ( handle ) {
8715
8745
  handle.apply( cur, data );
@@ -8734,7 +8764,7 @@ jQuery.extend( jQuery.event, {
8734
8764
  acceptData( elem ) ) {
8735
8765
 
8736
8766
  // Call a native DOM method on the target with the same name as the event.
8737
- // Don't do default actions on window, that's where global variables be (#6170)
8767
+ // Don't do default actions on window, that's where global variables be (trac-6170)
8738
8768
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8739
8769
 
8740
8770
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -8856,7 +8886,7 @@ var rquery = ( /\?/ );
8856
8886
 
8857
8887
  // Cross-browser xml parsing
8858
8888
  jQuery.parseXML = function( data ) {
8859
- var xml;
8889
+ var xml, parserErrorElem;
8860
8890
  if ( !data || typeof data !== "string" ) {
8861
8891
  return null;
8862
8892
  }
@@ -8865,12 +8895,17 @@ jQuery.parseXML = function( data ) {
8865
8895
  // IE throws on parseFromString with invalid input.
8866
8896
  try {
8867
8897
  xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8868
- } catch ( e ) {
8869
- xml = undefined;
8870
- }
8898
+ } catch ( e ) {}
8871
8899
 
8872
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8873
- jQuery.error( "Invalid XML: " + data );
8900
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
8901
+ if ( !xml || parserErrorElem ) {
8902
+ jQuery.error( "Invalid XML: " + (
8903
+ parserErrorElem ?
8904
+ jQuery.map( parserErrorElem.childNodes, function( el ) {
8905
+ return el.textContent;
8906
+ } ).join( "\n" ) :
8907
+ data
8908
+ ) );
8874
8909
  }
8875
8910
  return xml;
8876
8911
  };
@@ -8971,16 +9006,14 @@ jQuery.fn.extend( {
8971
9006
  // Can add propHook for "elements" to filter or add form elements
8972
9007
  var elements = jQuery.prop( this, "elements" );
8973
9008
  return elements ? jQuery.makeArray( elements ) : this;
8974
- } )
8975
- .filter( function() {
9009
+ } ).filter( function() {
8976
9010
  var type = this.type;
8977
9011
 
8978
9012
  // Use .is( ":disabled" ) so that fieldset[disabled] works
8979
9013
  return this.name && !jQuery( this ).is( ":disabled" ) &&
8980
9014
  rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8981
9015
  ( this.checked || !rcheckableType.test( type ) );
8982
- } )
8983
- .map( function( _i, elem ) {
9016
+ } ).map( function( _i, elem ) {
8984
9017
  var val = jQuery( this ).val();
8985
9018
 
8986
9019
  if ( val == null ) {
@@ -9005,7 +9038,7 @@ var
9005
9038
  rantiCache = /([?&])_=[^&]*/,
9006
9039
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
9007
9040
 
9008
- // #7653, #8125, #8152: local protocol detection
9041
+ // trac-7653, trac-8125, trac-8152: local protocol detection
9009
9042
  rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
9010
9043
  rnoContent = /^(?:GET|HEAD)$/,
9011
9044
  rprotocol = /^\/\//,
@@ -9028,12 +9061,13 @@ var
9028
9061
  */
9029
9062
  transports = {},
9030
9063
 
9031
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
9064
+ // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
9032
9065
  allTypes = "*/".concat( "*" ),
9033
9066
 
9034
9067
  // Anchor tag for parsing the document origin
9035
9068
  originAnchor = document.createElement( "a" );
9036
- originAnchor.href = location.href;
9069
+
9070
+ originAnchor.href = location.href;
9037
9071
 
9038
9072
  // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
9039
9073
  function addToPrefiltersOrTransports( structure ) {
@@ -9098,7 +9132,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
9098
9132
 
9099
9133
  // A special extend for ajax options
9100
9134
  // that takes "flat" options (not to be deep extended)
9101
- // Fixes #9887
9135
+ // Fixes trac-9887
9102
9136
  function ajaxExtend( target, src ) {
9103
9137
  var key, deep,
9104
9138
  flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9414,8 +9448,8 @@ jQuery.extend( {
9414
9448
  // Context for global events is callbackContext if it is a DOM node or jQuery collection
9415
9449
  globalEventContext = s.context &&
9416
9450
  ( callbackContext.nodeType || callbackContext.jquery ) ?
9417
- jQuery( callbackContext ) :
9418
- jQuery.event,
9451
+ jQuery( callbackContext ) :
9452
+ jQuery.event,
9419
9453
 
9420
9454
  // Deferreds
9421
9455
  deferred = jQuery.Deferred(),
@@ -9509,12 +9543,12 @@ jQuery.extend( {
9509
9543
  deferred.promise( jqXHR );
9510
9544
 
9511
9545
  // Add protocol if not provided (prefilters might expect it)
9512
- // Handle falsy url in the settings object (#10093: consistency with old signature)
9546
+ // Handle falsy url in the settings object (trac-10093: consistency with old signature)
9513
9547
  // We also use the url parameter if available
9514
9548
  s.url = ( ( url || s.url || location.href ) + "" )
9515
9549
  .replace( rprotocol, location.protocol + "//" );
9516
9550
 
9517
- // Alias method option to type as per ticket #12004
9551
+ // Alias method option to type as per ticket trac-12004
9518
9552
  s.type = options.method || options.type || s.method || s.type;
9519
9553
 
9520
9554
  // Extract dataTypes list
@@ -9557,7 +9591,7 @@ jQuery.extend( {
9557
9591
  }
9558
9592
 
9559
9593
  // We can fire global events as of now if asked to
9560
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9594
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
9561
9595
  fireGlobals = jQuery.event && s.global;
9562
9596
 
9563
9597
  // Watch for a new set of requests
@@ -9586,7 +9620,7 @@ jQuery.extend( {
9586
9620
  if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9587
9621
  cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9588
9622
 
9589
- // #9682: remove data so that it's not used in an eventual retry
9623
+ // trac-9682: remove data so that it's not used in an eventual retry
9590
9624
  delete s.data;
9591
9625
  }
9592
9626
 
@@ -9727,8 +9761,10 @@ jQuery.extend( {
9727
9761
  response = ajaxHandleResponses( s, jqXHR, responses );
9728
9762
  }
9729
9763
 
9730
- // Use a noop converter for missing script
9731
- if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
9764
+ // Use a noop converter for missing script but not if jsonp
9765
+ if ( !isSuccess &&
9766
+ jQuery.inArray( "script", s.dataTypes ) > -1 &&
9767
+ jQuery.inArray( "json", s.dataTypes ) < 0 ) {
9732
9768
  s.converters[ "text script" ] = function() {};
9733
9769
  }
9734
9770
 
@@ -9857,7 +9893,7 @@ jQuery._evalUrl = function( url, options, doc ) {
9857
9893
  return jQuery.ajax( {
9858
9894
  url: url,
9859
9895
 
9860
- // Make this explicit, since user can override this through ajaxSetup (#11264)
9896
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
9861
9897
  type: "GET",
9862
9898
  dataType: "script",
9863
9899
  cache: true,
@@ -9966,7 +10002,7 @@ var xhrSuccessStatus = {
9966
10002
  0: 200,
9967
10003
 
9968
10004
  // Support: IE <=9 only
9969
- // #1450: sometimes IE returns 1223 when it should be 204
10005
+ // trac-1450: sometimes IE returns 1223 when it should be 204
9970
10006
  1223: 204
9971
10007
  },
9972
10008
  xhrSupported = jQuery.ajaxSettings.xhr();
@@ -10038,7 +10074,7 @@ jQuery.ajaxTransport( function( options ) {
10038
10074
  } else {
10039
10075
  complete(
10040
10076
 
10041
- // File: protocol always yields status 0; see #8605, #14207
10077
+ // File: protocol always yields status 0; see trac-8605, trac-14207
10042
10078
  xhr.status,
10043
10079
  xhr.statusText
10044
10080
  );
@@ -10099,7 +10135,7 @@ jQuery.ajaxTransport( function( options ) {
10099
10135
  xhr.send( options.hasContent && options.data || null );
10100
10136
  } catch ( e ) {
10101
10137
 
10102
- // #14683: Only rethrow if this hasn't been notified as an error yet
10138
+ // trac-14683: Only rethrow if this hasn't been notified as an error yet
10103
10139
  if ( callback ) {
10104
10140
  throw e;
10105
10141
  }
@@ -10466,12 +10502,6 @@ jQuery.offset = {
10466
10502
  options.using.call( elem, props );
10467
10503
 
10468
10504
  } else {
10469
- if ( typeof props.top === "number" ) {
10470
- props.top += "px";
10471
- }
10472
- if ( typeof props.left === "number" ) {
10473
- props.left += "px";
10474
- }
10475
10505
  curElem.css( props );
10476
10506
  }
10477
10507
  }
@@ -10640,8 +10670,11 @@ jQuery.each( [ "top", "left" ], function( _i, prop ) {
10640
10670
 
10641
10671
  // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10642
10672
  jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10643
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10644
- function( defaultExtra, funcName ) {
10673
+ jQuery.each( {
10674
+ padding: "inner" + name,
10675
+ content: type,
10676
+ "": "outer" + name
10677
+ }, function( defaultExtra, funcName ) {
10645
10678
 
10646
10679
  // Margin is only for outerHeight, outerWidth
10647
10680
  jQuery.fn[ funcName ] = function( margin, value ) {
@@ -10726,7 +10759,8 @@ jQuery.fn.extend( {
10726
10759
  }
10727
10760
  } );
10728
10761
 
10729
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10762
+ jQuery.each(
10763
+ ( "blur focus focusin focusout resize scroll click dblclick " +
10730
10764
  "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10731
10765
  "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10732
10766
  function( _i, name ) {
@@ -10737,14 +10771,17 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10737
10771
  this.on( name, null, data, fn ) :
10738
10772
  this.trigger( name );
10739
10773
  };
10740
- } );
10774
+ }
10775
+ );
10741
10776
 
10742
10777
 
10743
10778
 
10744
10779
 
10745
10780
  // Support: Android <=4.0 only
10746
10781
  // Make sure we trim BOM and NBSP
10747
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
10782
+ // Require that the "whitespace run" starts from a non-whitespace
10783
+ // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
10784
+ var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
10748
10785
 
10749
10786
  // Bind a function to a context, optionally partially applying any
10750
10787
  // arguments.
@@ -10811,7 +10848,7 @@ jQuery.isNumeric = function( obj ) {
10811
10848
  jQuery.trim = function( text ) {
10812
10849
  return text == null ?
10813
10850
  "" :
10814
- ( text + "" ).replace( rtrim, "" );
10851
+ ( text + "" ).replace( rtrim, "$1" );
10815
10852
  };
10816
10853
 
10817
10854
 
@@ -10859,8 +10896,8 @@ jQuery.noConflict = function( deep ) {
10859
10896
  };
10860
10897
 
10861
10898
  // Expose jQuery and $ identifiers, even in AMD
10862
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10863
- // and CommonJS for browser emulators (#13566)
10899
+ // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
10900
+ // and CommonJS for browser emulators (trac-13566)
10864
10901
  if ( typeof noGlobal === "undefined" ) {
10865
10902
  window.jQuery = window.$ = jQuery;
10866
10903
  }