jquery-rails 4.5.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2e8c88996b29e72c469e7f67c68011b385dfa005fb1889d5a1a96e9e13c282e
4
- data.tar.gz: 546c44d56ab3aba53d497a12fc4a5ae7e07edd75c3aa15f9395d866851576286
3
+ metadata.gz: dc824faad0a0e721766ec6ae2c9e3f6dceaff6d5528066fb82905dbb9febe2e4
4
+ data.tar.gz: 5e5d2d38463e03b1ad8e64f758912175dc61aedfd4e671d82d43199edfcb39bf
5
5
  SHA512:
6
- metadata.gz: 74e86d80b32cc72a37bbfb6c5897bb5c2b7a4d5f798234a93aa335dc4d32fd9bde1b602436c8c1275ebe31b9f133a172ff0f82698979ab8ff1707b59077bb32a
7
- data.tar.gz: 5bee22c8751e58d1b82b1aa7a6fdcf382cb884150ce5f1a0d03d2736f24c9ba26e1565657c3edc4c87273490bbd02646bb04b7e9670bb2fc8640e0e902220b0d
6
+ metadata.gz: 9038bfa9cfed8472d97b801c2389712d27c964720e75d79894c51422fc58187816757c830fe58aff0968f123a1d500203e4dc0ca18efeeb794693f2d96718702
7
+ data.tar.gz: 11775380be70000f3abf0e64c4a831f935e3be40f90d12eede256a8e44ae3b019cf8e932d8ff5ed6dd7f2ca01215590d55885e24bff7f43662746456d691e893
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## unreleased
2
+
3
+ - update jquery to 3.6.1
4
+ - update jquery-usj to 1.2.3
5
+
1
6
  ## 4.5.0
2
7
 
3
8
  - update jquery to 3.6.0
@@ -25,7 +30,7 @@
25
30
  - update jquery to 3.3.0
26
31
  - Add possibility to test HTML: all, attribute prefix, attribute contains,
27
32
  attribute ends with, child, and class selectors
28
- - Fix matching mutiple calls for the same selector/function exception
33
+ - Fix matching multiple calls for the same selector/function exception
29
34
 
30
35
  ## 4.3.1
31
36
 
data/VERSIONS.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  | Gem | jQuery | jQuery UJS | jQuery UI |
4
4
  |--------|--------|------------| ----------|
5
+ | 4.5.1 | 1.12.4 & 2.2.4 & 3.6.1 | 1.2.3 | - |
5
6
  | 4.5.0 | 1.12.4 & 2.2.4 & 3.6.0 | 1.2.2 | - |
6
7
  | 4.4.0 | 1.12.4 & 2.2.4 & 3.5.1 | 1.2.2 | - |
7
8
  | 4.3.5 | 1.12.4 & 2.2.4 & 3.4.1 | 1.2.2 | - |
@@ -1,9 +1,9 @@
1
1
  module Jquery
2
2
  module Rails
3
- VERSION = "4.5.0"
3
+ VERSION = "4.5.1"
4
4
  JQUERY_VERSION = "1.12.4"
5
5
  JQUERY_2_VERSION = "2.2.4"
6
- JQUERY_3_VERSION = "3.6.0"
7
- JQUERY_UJS_VERSION = "1.2.2"
6
+ JQUERY_3_VERSION = "3.6.1"
7
+ JQUERY_UJS_VERSION = "1.2.3"
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jQuery JavaScript Library v3.6.0
2
+ * jQuery JavaScript Library v3.6.1
3
3
  * https://jquery.com/
4
4
  *
5
5
  * Includes Sizzle.js
@@ -9,7 +9,7 @@
9
9
  * Released under the MIT license
10
10
  * https://jquery.org/license
11
11
  *
12
- * Date: 2021-03-02T17:08Z
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 ) {
@@ -151,7 +151,7 @@ function toType( obj ) {
151
151
 
152
152
 
153
153
  var
154
- version = "3.6.0",
154
+ version = "3.6.1",
155
155
 
156
156
  // Define a local copy of jQuery
157
157
  jQuery = function( selector, context ) {
@@ -3129,8 +3129,8 @@ jQuery.fn.extend( {
3129
3129
  var rootjQuery,
3130
3130
 
3131
3131
  // A simple way to check for HTML strings
3132
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
3133
- // 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 <)
3134
3134
  // Shortcut simple #id case for speed
3135
3135
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3136
3136
 
@@ -4087,7 +4087,7 @@ jQuery.extend( {
4087
4087
  isReady: false,
4088
4088
 
4089
4089
  // A counter to track how many items to wait for before
4090
- // the ready event fires. See #6781
4090
+ // the ready event fires. See trac-6781
4091
4091
  readyWait: 1,
4092
4092
 
4093
4093
  // Handle when the DOM is ready
@@ -4215,7 +4215,7 @@ function fcamelCase( _all, letter ) {
4215
4215
 
4216
4216
  // Convert dashed to camelCase; used by the css and data modules
4217
4217
  // Support: IE <=9 - 11, Edge 12 - 15
4218
- // Microsoft forgot to hump their vendor prefix (#9572)
4218
+ // Microsoft forgot to hump their vendor prefix (trac-9572)
4219
4219
  function camelCase( string ) {
4220
4220
  return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4221
4221
  }
@@ -4251,7 +4251,7 @@ Data.prototype = {
4251
4251
  value = {};
4252
4252
 
4253
4253
  // We can accept data for non-element nodes in modern browsers,
4254
- // but we should not, see #8335.
4254
+ // but we should not, see trac-8335.
4255
4255
  // Always return an empty object.
4256
4256
  if ( acceptData( owner ) ) {
4257
4257
 
@@ -4490,7 +4490,7 @@ jQuery.fn.extend( {
4490
4490
  while ( i-- ) {
4491
4491
 
4492
4492
  // Support: IE 11 only
4493
- // The attrs elements can be null (#14894)
4493
+ // The attrs elements can be null (trac-14894)
4494
4494
  if ( attrs[ i ] ) {
4495
4495
  name = attrs[ i ].name;
4496
4496
  if ( name.indexOf( "data-" ) === 0 ) {
@@ -4913,9 +4913,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4913
4913
  input = document.createElement( "input" );
4914
4914
 
4915
4915
  // Support: Android 4.0 - 4.3 only
4916
- // Check state lost if the name is set (#11217)
4916
+ // Check state lost if the name is set (trac-11217)
4917
4917
  // Support: Windows Web Apps (WWA)
4918
- // `name` and `type` must use .setAttribute for WWA (#14901)
4918
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
4919
4919
  input.setAttribute( "type", "radio" );
4920
4920
  input.setAttribute( "checked", "checked" );
4921
4921
  input.setAttribute( "name", "t" );
@@ -4939,7 +4939,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4939
4939
  } )();
4940
4940
 
4941
4941
 
4942
- // We have to close these tags to support XHTML (#13200)
4942
+ // We have to close these tags to support XHTML (trac-13200)
4943
4943
  var wrapMap = {
4944
4944
 
4945
4945
  // XHTML parsers do not magically insert elements in the
@@ -4965,7 +4965,7 @@ if ( !support.option ) {
4965
4965
  function getAll( context, tag ) {
4966
4966
 
4967
4967
  // Support: IE <=9 - 11 only
4968
- // 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)
4969
4969
  var ret;
4970
4970
 
4971
4971
  if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -5048,7 +5048,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5048
5048
  // Remember the top-level container
5049
5049
  tmp = fragment.firstChild;
5050
5050
 
5051
- // Ensure the created nodes are orphaned (#12392)
5051
+ // Ensure the created nodes are orphaned (trac-12392)
5052
5052
  tmp.textContent = "";
5053
5053
  }
5054
5054
  }
@@ -5469,15 +5469,15 @@ jQuery.event = {
5469
5469
 
5470
5470
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5471
5471
 
5472
- // Don't check non-elements (#13208)
5473
- // 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)
5474
5474
  if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5475
5475
  matchedHandlers = [];
5476
5476
  matchedSelectors = {};
5477
5477
  for ( i = 0; i < delegateCount; i++ ) {
5478
5478
  handleObj = handlers[ i ];
5479
5479
 
5480
- // Don't conflict with Object.prototype properties (#13203)
5480
+ // Don't conflict with Object.prototype properties (trac-13203)
5481
5481
  sel = handleObj.selector + " ";
5482
5482
 
5483
5483
  if ( matchedSelectors[ sel ] === undefined ) {
@@ -5731,7 +5731,7 @@ jQuery.Event = function( src, props ) {
5731
5731
 
5732
5732
  // Create target properties
5733
5733
  // Support: Safari <=6 - 7 only
5734
- // Target should not be a text node (#504, #13143)
5734
+ // Target should not be a text node (trac-504, trac-13143)
5735
5735
  this.target = ( src.target && src.target.nodeType === 3 ) ?
5736
5736
  src.target.parentNode :
5737
5737
  src.target;
@@ -5854,10 +5854,10 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
5854
5854
  return true;
5855
5855
  },
5856
5856
 
5857
- // Suppress native focus or blur as it's already being fired
5858
- // in leverageNative.
5859
- _default: function() {
5860
- return true;
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
5861
  },
5862
5862
 
5863
5863
  delegateType: delegateType
@@ -5956,7 +5956,8 @@ var
5956
5956
 
5957
5957
  // checked="checked" or checked
5958
5958
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5959
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5959
+
5960
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5960
5961
 
5961
5962
  // Prefer a tbody over its parent table for containing new rows
5962
5963
  function manipulationTarget( elem, content ) {
@@ -6070,7 +6071,7 @@ function domManip( collection, args, callback, ignored ) {
6070
6071
 
6071
6072
  // Use the original fragment for the last item
6072
6073
  // instead of the first because it can end up
6073
- // being emptied incorrectly in certain situations (#8070).
6074
+ // being emptied incorrectly in certain situations (trac-8070).
6074
6075
  for ( ; i < l; i++ ) {
6075
6076
  node = fragment;
6076
6077
 
@@ -6111,6 +6112,12 @@ function domManip( collection, args, callback, ignored ) {
6111
6112
  }, doc );
6112
6113
  }
6113
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.
6114
6121
  DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6115
6122
  }
6116
6123
  }
@@ -6393,9 +6400,12 @@ jQuery.each( {
6393
6400
  } );
6394
6401
  var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6395
6402
 
6403
+ var rcustomProp = /^--/;
6404
+
6405
+
6396
6406
  var getStyles = function( elem ) {
6397
6407
 
6398
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6408
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6399
6409
  // IE throws on elements created in popups
6400
6410
  // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6401
6411
  var view = elem.ownerDocument.defaultView;
@@ -6430,6 +6440,15 @@ var swap = function( elem, options, callback ) {
6430
6440
 
6431
6441
  var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6432
6442
 
6443
+ var whitespace = "[\\x20\\t\\r\\n\\f]";
6444
+
6445
+
6446
+ var rtrimCSS = new RegExp(
6447
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6448
+ "g"
6449
+ );
6450
+
6451
+
6433
6452
 
6434
6453
 
6435
6454
  ( function() {
@@ -6495,7 +6514,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6495
6514
  }
6496
6515
 
6497
6516
  // Support: IE <=9 - 11 only
6498
- // Style of cloned element affects source element cloned (#8908)
6517
+ // Style of cloned element affects source element cloned (trac-8908)
6499
6518
  div.style.backgroundClip = "content-box";
6500
6519
  div.cloneNode( true ).style.backgroundClip = "";
6501
6520
  support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6575,6 +6594,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6575
6594
 
6576
6595
  function curCSS( elem, name, computed ) {
6577
6596
  var width, minWidth, maxWidth, ret,
6597
+ isCustomProp = rcustomProp.test( name ),
6578
6598
 
6579
6599
  // Support: Firefox 51+
6580
6600
  // Retrieving style before computed somehow
@@ -6585,11 +6605,22 @@ function curCSS( elem, name, computed ) {
6585
6605
  computed = computed || getStyles( elem );
6586
6606
 
6587
6607
  // getPropertyValue is needed for:
6588
- // .css('filter') (IE 9 only, #12537)
6589
- // .css('--customProperty) (#3144)
6608
+ // .css('filter') (IE 9 only, trac-12537)
6609
+ // .css('--customProperty) (gh-3144)
6590
6610
  if ( computed ) {
6591
6611
  ret = computed.getPropertyValue( name ) || computed[ name ];
6592
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
+
6593
6624
  if ( ret === "" && !isAttached( elem ) ) {
6594
6625
  ret = jQuery.style( elem, name );
6595
6626
  }
@@ -6685,7 +6716,6 @@ var
6685
6716
  // except "table", "table-cell", or "table-caption"
6686
6717
  // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6687
6718
  rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6688
- rcustomProp = /^--/,
6689
6719
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6690
6720
  cssNormalTransform = {
6691
6721
  letterSpacing: "0",
@@ -6921,15 +6951,15 @@ jQuery.extend( {
6921
6951
  if ( value !== undefined ) {
6922
6952
  type = typeof value;
6923
6953
 
6924
- // Convert "+=" or "-=" to relative numbers (#7345)
6954
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
6925
6955
  if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6926
6956
  value = adjustCSS( elem, name, ret );
6927
6957
 
6928
- // Fixes bug #9237
6958
+ // Fixes bug trac-9237
6929
6959
  type = "number";
6930
6960
  }
6931
6961
 
6932
- // Make sure that null and NaN values aren't set (#7116)
6962
+ // Make sure that null and NaN values aren't set (trac-7116)
6933
6963
  if ( value == null || value !== value ) {
6934
6964
  return;
6935
6965
  }
@@ -7553,7 +7583,7 @@ function Animation( elem, properties, options ) {
7553
7583
  remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7554
7584
 
7555
7585
  // Support: Android 2.3 only
7556
- // 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)
7557
7587
  temp = remaining / animation.duration || 0,
7558
7588
  percent = 1 - temp,
7559
7589
  index = 0,
@@ -7943,7 +7973,6 @@ jQuery.fx.speeds = {
7943
7973
 
7944
7974
 
7945
7975
  // Based off of the plugin by Clint Helfers, with permission.
7946
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7947
7976
  jQuery.fn.delay = function( time, type ) {
7948
7977
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7949
7978
  type = type || "fx";
@@ -8168,8 +8197,7 @@ jQuery.extend( {
8168
8197
  // Support: IE <=9 - 11 only
8169
8198
  // elem.tabIndex doesn't always return the
8170
8199
  // correct value when it hasn't been explicitly set
8171
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8172
- // Use proper attribute retrieval(#12072)
8200
+ // Use proper attribute retrieval (trac-12072)
8173
8201
  var tabindex = jQuery.find.attr( elem, "tabindex" );
8174
8202
 
8175
8203
  if ( tabindex ) {
@@ -8273,8 +8301,7 @@ function classesToArray( value ) {
8273
8301
 
8274
8302
  jQuery.fn.extend( {
8275
8303
  addClass: function( value ) {
8276
- var classes, elem, cur, curValue, clazz, j, finalValue,
8277
- i = 0;
8304
+ var classNames, cur, curValue, className, i, finalValue;
8278
8305
 
8279
8306
  if ( isFunction( value ) ) {
8280
8307
  return this.each( function( j ) {
@@ -8282,36 +8309,35 @@ jQuery.fn.extend( {
8282
8309
  } );
8283
8310
  }
8284
8311
 
8285
- classes = classesToArray( value );
8312
+ classNames = classesToArray( value );
8286
8313
 
8287
- if ( classes.length ) {
8288
- while ( ( elem = this[ i++ ] ) ) {
8289
- curValue = getClass( elem );
8290
- 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 ) + " " );
8291
8318
 
8292
8319
  if ( cur ) {
8293
- j = 0;
8294
- while ( ( clazz = classes[ j++ ] ) ) {
8295
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8296
- cur += clazz + " ";
8320
+ for ( i = 0; i < classNames.length; i++ ) {
8321
+ className = classNames[ i ];
8322
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
8323
+ cur += className + " ";
8297
8324
  }
8298
8325
  }
8299
8326
 
8300
8327
  // Only assign if different to avoid unneeded rendering.
8301
8328
  finalValue = stripAndCollapse( cur );
8302
8329
  if ( curValue !== finalValue ) {
8303
- elem.setAttribute( "class", finalValue );
8330
+ this.setAttribute( "class", finalValue );
8304
8331
  }
8305
8332
  }
8306
- }
8333
+ } );
8307
8334
  }
8308
8335
 
8309
8336
  return this;
8310
8337
  },
8311
8338
 
8312
8339
  removeClass: function( value ) {
8313
- var classes, elem, cur, curValue, clazz, j, finalValue,
8314
- i = 0;
8340
+ var classNames, cur, curValue, className, i, finalValue;
8315
8341
 
8316
8342
  if ( isFunction( value ) ) {
8317
8343
  return this.each( function( j ) {
@@ -8323,45 +8349,42 @@ jQuery.fn.extend( {
8323
8349
  return this.attr( "class", "" );
8324
8350
  }
8325
8351
 
8326
- classes = classesToArray( value );
8352
+ classNames = classesToArray( value );
8327
8353
 
8328
- if ( classes.length ) {
8329
- while ( ( elem = this[ i++ ] ) ) {
8330
- curValue = getClass( elem );
8354
+ if ( classNames.length ) {
8355
+ return this.each( function() {
8356
+ curValue = getClass( this );
8331
8357
 
8332
8358
  // This expression is here for better compressibility (see addClass)
8333
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8359
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8334
8360
 
8335
8361
  if ( cur ) {
8336
- j = 0;
8337
- while ( ( clazz = classes[ j++ ] ) ) {
8362
+ for ( i = 0; i < classNames.length; i++ ) {
8363
+ className = classNames[ i ];
8338
8364
 
8339
8365
  // Remove *all* instances
8340
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8341
- cur = cur.replace( " " + clazz + " ", " " );
8366
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
8367
+ cur = cur.replace( " " + className + " ", " " );
8342
8368
  }
8343
8369
  }
8344
8370
 
8345
8371
  // Only assign if different to avoid unneeded rendering.
8346
8372
  finalValue = stripAndCollapse( cur );
8347
8373
  if ( curValue !== finalValue ) {
8348
- elem.setAttribute( "class", finalValue );
8374
+ this.setAttribute( "class", finalValue );
8349
8375
  }
8350
8376
  }
8351
- }
8377
+ } );
8352
8378
  }
8353
8379
 
8354
8380
  return this;
8355
8381
  },
8356
8382
 
8357
8383
  toggleClass: function( value, stateVal ) {
8358
- var type = typeof value,
8384
+ var classNames, className, i, self,
8385
+ type = typeof value,
8359
8386
  isValidValue = type === "string" || Array.isArray( value );
8360
8387
 
8361
- if ( typeof stateVal === "boolean" && isValidValue ) {
8362
- return stateVal ? this.addClass( value ) : this.removeClass( value );
8363
- }
8364
-
8365
8388
  if ( isFunction( value ) ) {
8366
8389
  return this.each( function( i ) {
8367
8390
  jQuery( this ).toggleClass(
@@ -8371,17 +8394,20 @@ jQuery.fn.extend( {
8371
8394
  } );
8372
8395
  }
8373
8396
 
8374
- return this.each( function() {
8375
- var className, i, self, classNames;
8397
+ if ( typeof stateVal === "boolean" && isValidValue ) {
8398
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
8399
+ }
8400
+
8401
+ classNames = classesToArray( value );
8376
8402
 
8403
+ return this.each( function() {
8377
8404
  if ( isValidValue ) {
8378
8405
 
8379
8406
  // Toggle individual class names
8380
- i = 0;
8381
8407
  self = jQuery( this );
8382
- classNames = classesToArray( value );
8383
8408
 
8384
- while ( ( className = classNames[ i++ ] ) ) {
8409
+ for ( i = 0; i < classNames.length; i++ ) {
8410
+ className = classNames[ i ];
8385
8411
 
8386
8412
  // Check each className given, space separated list
8387
8413
  if ( self.hasClass( className ) ) {
@@ -8515,7 +8541,7 @@ jQuery.extend( {
8515
8541
  val :
8516
8542
 
8517
8543
  // Support: IE <=10 - 11 only
8518
- // option.text throws exceptions (#14686, #14858)
8544
+ // option.text throws exceptions (trac-14686, trac-14858)
8519
8545
  // Strip and collapse whitespace
8520
8546
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8521
8547
  stripAndCollapse( jQuery.text( elem ) );
@@ -8542,7 +8568,7 @@ jQuery.extend( {
8542
8568
  option = options[ i ];
8543
8569
 
8544
8570
  // Support: IE <=9 only
8545
- // IE8-9 doesn't update selected after form reset (#2551)
8571
+ // IE8-9 doesn't update selected after form reset (trac-2551)
8546
8572
  if ( ( option.selected || i === index ) &&
8547
8573
 
8548
8574
  // Don't return options that are disabled or in a disabled optgroup
@@ -8685,8 +8711,8 @@ jQuery.extend( jQuery.event, {
8685
8711
  return;
8686
8712
  }
8687
8713
 
8688
- // Determine event propagation path in advance, per W3C events spec (#9951)
8689
- // 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)
8690
8716
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8691
8717
 
8692
8718
  bubbleType = special.delegateType || type;
@@ -8738,7 +8764,7 @@ jQuery.extend( jQuery.event, {
8738
8764
  acceptData( elem ) ) {
8739
8765
 
8740
8766
  // Call a native DOM method on the target with the same name as the event.
8741
- // 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)
8742
8768
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8743
8769
 
8744
8770
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -9012,7 +9038,7 @@ var
9012
9038
  rantiCache = /([?&])_=[^&]*/,
9013
9039
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
9014
9040
 
9015
- // #7653, #8125, #8152: local protocol detection
9041
+ // trac-7653, trac-8125, trac-8152: local protocol detection
9016
9042
  rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
9017
9043
  rnoContent = /^(?:GET|HEAD)$/,
9018
9044
  rprotocol = /^\/\//,
@@ -9035,7 +9061,7 @@ var
9035
9061
  */
9036
9062
  transports = {},
9037
9063
 
9038
- // 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
9039
9065
  allTypes = "*/".concat( "*" ),
9040
9066
 
9041
9067
  // Anchor tag for parsing the document origin
@@ -9106,7 +9132,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
9106
9132
 
9107
9133
  // A special extend for ajax options
9108
9134
  // that takes "flat" options (not to be deep extended)
9109
- // Fixes #9887
9135
+ // Fixes trac-9887
9110
9136
  function ajaxExtend( target, src ) {
9111
9137
  var key, deep,
9112
9138
  flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9517,12 +9543,12 @@ jQuery.extend( {
9517
9543
  deferred.promise( jqXHR );
9518
9544
 
9519
9545
  // Add protocol if not provided (prefilters might expect it)
9520
- // 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)
9521
9547
  // We also use the url parameter if available
9522
9548
  s.url = ( ( url || s.url || location.href ) + "" )
9523
9549
  .replace( rprotocol, location.protocol + "//" );
9524
9550
 
9525
- // Alias method option to type as per ticket #12004
9551
+ // Alias method option to type as per ticket trac-12004
9526
9552
  s.type = options.method || options.type || s.method || s.type;
9527
9553
 
9528
9554
  // Extract dataTypes list
@@ -9565,7 +9591,7 @@ jQuery.extend( {
9565
9591
  }
9566
9592
 
9567
9593
  // We can fire global events as of now if asked to
9568
- // 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)
9569
9595
  fireGlobals = jQuery.event && s.global;
9570
9596
 
9571
9597
  // Watch for a new set of requests
@@ -9594,7 +9620,7 @@ jQuery.extend( {
9594
9620
  if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9595
9621
  cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9596
9622
 
9597
- // #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
9598
9624
  delete s.data;
9599
9625
  }
9600
9626
 
@@ -9867,7 +9893,7 @@ jQuery._evalUrl = function( url, options, doc ) {
9867
9893
  return jQuery.ajax( {
9868
9894
  url: url,
9869
9895
 
9870
- // Make this explicit, since user can override this through ajaxSetup (#11264)
9896
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
9871
9897
  type: "GET",
9872
9898
  dataType: "script",
9873
9899
  cache: true,
@@ -9976,7 +10002,7 @@ var xhrSuccessStatus = {
9976
10002
  0: 200,
9977
10003
 
9978
10004
  // Support: IE <=9 only
9979
- // #1450: sometimes IE returns 1223 when it should be 204
10005
+ // trac-1450: sometimes IE returns 1223 when it should be 204
9980
10006
  1223: 204
9981
10007
  },
9982
10008
  xhrSupported = jQuery.ajaxSettings.xhr();
@@ -10048,7 +10074,7 @@ jQuery.ajaxTransport( function( options ) {
10048
10074
  } else {
10049
10075
  complete(
10050
10076
 
10051
- // File: protocol always yields status 0; see #8605, #14207
10077
+ // File: protocol always yields status 0; see trac-8605, trac-14207
10052
10078
  xhr.status,
10053
10079
  xhr.statusText
10054
10080
  );
@@ -10109,7 +10135,7 @@ jQuery.ajaxTransport( function( options ) {
10109
10135
  xhr.send( options.hasContent && options.data || null );
10110
10136
  } catch ( e ) {
10111
10137
 
10112
- // #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
10113
10139
  if ( callback ) {
10114
10140
  throw e;
10115
10141
  }
@@ -10753,7 +10779,9 @@ jQuery.each(
10753
10779
 
10754
10780
  // Support: Android <=4.0 only
10755
10781
  // Make sure we trim BOM and NBSP
10756
- 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;
10757
10785
 
10758
10786
  // Bind a function to a context, optionally partially applying any
10759
10787
  // arguments.
@@ -10820,7 +10848,7 @@ jQuery.isNumeric = function( obj ) {
10820
10848
  jQuery.trim = function( text ) {
10821
10849
  return text == null ?
10822
10850
  "" :
10823
- ( text + "" ).replace( rtrim, "" );
10851
+ ( text + "" ).replace( rtrim, "$1" );
10824
10852
  };
10825
10853
 
10826
10854
 
@@ -10868,8 +10896,8 @@ jQuery.noConflict = function( deep ) {
10868
10896
  };
10869
10897
 
10870
10898
  // Expose jQuery and $ identifiers, even in AMD
10871
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10872
- // 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)
10873
10901
  if ( typeof noGlobal === "undefined" ) {
10874
10902
  window.jQuery = window.$ = jQuery;
10875
10903
  }