utopia-project 0.20.3 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jQuery JavaScript Library v3.6.0 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector
2
+ * jQuery JavaScript Library v3.6.3 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector
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-12-20T21:28Z
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 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector",
154
+ version = "3.6.3 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector",
155
155
 
156
156
  // Define a local copy of jQuery
157
157
  jQuery = function( selector, context ) {
@@ -522,14 +522,14 @@ function isArrayLike( obj ) {
522
522
  }
523
523
  var Sizzle =
524
524
  /*!
525
- * Sizzle CSS Selector Engine v2.3.6
525
+ * Sizzle CSS Selector Engine v2.3.9
526
526
  * https://sizzlejs.com/
527
527
  *
528
528
  * Copyright JS Foundation and other contributors
529
529
  * Released under the MIT license
530
530
  * https://js.foundation/
531
531
  *
532
- * Date: 2021-02-16
532
+ * Date: 2022-12-19
533
533
  */
534
534
  ( function( window ) {
535
535
  var i,
@@ -879,6 +879,27 @@ function Sizzle( selector, context, results, seed ) {
879
879
  }
880
880
 
881
881
  try {
882
+
883
+ // `qSA` may not throw for unrecognized parts using forgiving parsing:
884
+ // https://drafts.csswg.org/selectors/#forgiving-selector
885
+ // like the `:has()` pseudo-class:
886
+ // https://drafts.csswg.org/selectors/#relational
887
+ // `CSS.supports` is still expected to return `false` then:
888
+ // https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn
889
+ // https://drafts.csswg.org/css-conditional-4/#dfn-support-selector
890
+ if ( support.cssSupportsSelector &&
891
+
892
+ // eslint-disable-next-line no-undef
893
+ !CSS.supports( "selector(:is(" + newSelector + "))" ) ) {
894
+
895
+ // Support: IE 11+
896
+ // Throw to get to the same code path as an error directly in qSA.
897
+ // Note: once we only support browser supporting
898
+ // `CSS.supports('selector(...)')`, we can most likely drop
899
+ // the `try-catch`. IE doesn't implement the API.
900
+ throw new Error();
901
+ }
902
+
882
903
  push.apply( results,
883
904
  newContext.querySelectorAll( newSelector )
884
905
  );
@@ -1174,6 +1195,31 @@ setDocument = Sizzle.setDocument = function( node ) {
1174
1195
  !el.querySelectorAll( ":scope fieldset div" ).length;
1175
1196
  } );
1176
1197
 
1198
+ // Support: Chrome 105+, Firefox 104+, Safari 15.4+
1199
+ // Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`.
1200
+ //
1201
+ // `:is()` uses a forgiving selector list as an argument and is widely
1202
+ // implemented, so it's a good one to test against.
1203
+ support.cssSupportsSelector = assert( function() {
1204
+ /* eslint-disable no-undef */
1205
+
1206
+ return CSS.supports( "selector(*)" ) &&
1207
+
1208
+ // Support: Firefox 78-81 only
1209
+ // In old Firefox, `:is()` didn't use forgiving parsing. In that case,
1210
+ // fail this test as there's no selector to test against that.
1211
+ // `CSS.supports` uses unforgiving parsing
1212
+ document.querySelectorAll( ":is(:jqfake)" ) &&
1213
+
1214
+ // `*` is needed as Safari & newer Chrome implemented something in between
1215
+ // for `:has()` - it throws in `qSA` if it only contains an unsupported
1216
+ // argument but multiple ones, one of which is supported, are fine.
1217
+ // We want to play safe in case `:is()` gets the same treatment.
1218
+ !CSS.supports( "selector(:is(*,:jqfake))" );
1219
+
1220
+ /* eslint-enable */
1221
+ } );
1222
+
1177
1223
  /* Attributes
1178
1224
  ---------------------------------------------------------------------- */
1179
1225
 
@@ -1440,6 +1486,17 @@ setDocument = Sizzle.setDocument = function( node ) {
1440
1486
  } );
1441
1487
  }
1442
1488
 
1489
+ if ( !support.cssSupportsSelector ) {
1490
+
1491
+ // Support: Chrome 105+, Safari 15.4+
1492
+ // `:has()` uses a forgiving selector list as an argument so our regular
1493
+ // `try-catch` mechanism fails to catch `:has()` with arguments not supported
1494
+ // natively like `:has(:contains("Foo"))`. Where supported & spec-compliant,
1495
+ // we now use `CSS.supports("selector(:is(SELECTOR_TO_BE_TESTED))")`, but
1496
+ // outside that we mark `:has` as buggy.
1497
+ rbuggyQSA.push( ":has" );
1498
+ }
1499
+
1443
1500
  rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
1444
1501
  rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
1445
1502
 
@@ -1452,7 +1509,14 @@ setDocument = Sizzle.setDocument = function( node ) {
1452
1509
  // As in, an element does not contain itself
1453
1510
  contains = hasCompare || rnative.test( docElem.contains ) ?
1454
1511
  function( a, b ) {
1455
- var adown = a.nodeType === 9 ? a.documentElement : a,
1512
+
1513
+ // Support: IE <9 only
1514
+ // IE doesn't have `contains` on `document` so we need to check for
1515
+ // `documentElement` presence.
1516
+ // We need to fall back to `a` when `documentElement` is missing
1517
+ // as `ownerDocument` of elements within `<template/>` may have
1518
+ // a null one - a default behavior of all modern browsers.
1519
+ var adown = a.nodeType === 9 && a.documentElement || a,
1456
1520
  bup = b && b.parentNode;
1457
1521
  return a === bup || !!( bup && bup.nodeType === 1 && (
1458
1522
  adown.contains ?
@@ -2242,7 +2306,7 @@ Expr = Sizzle.selectors = {
2242
2306
  return elem.nodeName.toLowerCase() === "input" &&
2243
2307
  elem.type === "text" &&
2244
2308
 
2245
- // Support: IE<8
2309
+ // Support: IE <10 only
2246
2310
  // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2247
2311
  ( ( attr = elem.getAttribute( "type" ) ) == null ||
2248
2312
  attr.toLowerCase() === "text" );
@@ -3129,8 +3193,8 @@ jQuery.fn.extend( {
3129
3193
  var rootjQuery,
3130
3194
 
3131
3195
  // 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 <)
3196
+ // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
3197
+ // Strict HTML recognition (trac-11290: must start with <)
3134
3198
  // Shortcut simple #id case for speed
3135
3199
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3136
3200
 
@@ -4087,7 +4151,7 @@ jQuery.extend( {
4087
4151
  isReady: false,
4088
4152
 
4089
4153
  // A counter to track how many items to wait for before
4090
- // the ready event fires. See #6781
4154
+ // the ready event fires. See trac-6781
4091
4155
  readyWait: 1,
4092
4156
 
4093
4157
  // Handle when the DOM is ready
@@ -4215,7 +4279,7 @@ function fcamelCase( _all, letter ) {
4215
4279
 
4216
4280
  // Convert dashed to camelCase; used by the css and data modules
4217
4281
  // Support: IE <=9 - 11, Edge 12 - 15
4218
- // Microsoft forgot to hump their vendor prefix (#9572)
4282
+ // Microsoft forgot to hump their vendor prefix (trac-9572)
4219
4283
  function camelCase( string ) {
4220
4284
  return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4221
4285
  }
@@ -4251,7 +4315,7 @@ Data.prototype = {
4251
4315
  value = {};
4252
4316
 
4253
4317
  // We can accept data for non-element nodes in modern browsers,
4254
- // but we should not, see #8335.
4318
+ // but we should not, see trac-8335.
4255
4319
  // Always return an empty object.
4256
4320
  if ( acceptData( owner ) ) {
4257
4321
 
@@ -4490,7 +4554,7 @@ jQuery.fn.extend( {
4490
4554
  while ( i-- ) {
4491
4555
 
4492
4556
  // Support: IE 11 only
4493
- // The attrs elements can be null (#14894)
4557
+ // The attrs elements can be null (trac-14894)
4494
4558
  if ( attrs[ i ] ) {
4495
4559
  name = attrs[ i ].name;
4496
4560
  if ( name.indexOf( "data-" ) === 0 ) {
@@ -4913,9 +4977,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4913
4977
  input = document.createElement( "input" );
4914
4978
 
4915
4979
  // Support: Android 4.0 - 4.3 only
4916
- // Check state lost if the name is set (#11217)
4980
+ // Check state lost if the name is set (trac-11217)
4917
4981
  // Support: Windows Web Apps (WWA)
4918
- // `name` and `type` must use .setAttribute for WWA (#14901)
4982
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
4919
4983
  input.setAttribute( "type", "radio" );
4920
4984
  input.setAttribute( "checked", "checked" );
4921
4985
  input.setAttribute( "name", "t" );
@@ -4939,7 +5003,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4939
5003
  } )();
4940
5004
 
4941
5005
 
4942
- // We have to close these tags to support XHTML (#13200)
5006
+ // We have to close these tags to support XHTML (trac-13200)
4943
5007
  var wrapMap = {
4944
5008
 
4945
5009
  // XHTML parsers do not magically insert elements in the
@@ -4965,7 +5029,7 @@ if ( !support.option ) {
4965
5029
  function getAll( context, tag ) {
4966
5030
 
4967
5031
  // Support: IE <=9 - 11 only
4968
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
5032
+ // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
4969
5033
  var ret;
4970
5034
 
4971
5035
  if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -5048,7 +5112,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5048
5112
  // Remember the top-level container
5049
5113
  tmp = fragment.firstChild;
5050
5114
 
5051
- // Ensure the created nodes are orphaned (#12392)
5115
+ // Ensure the created nodes are orphaned (trac-12392)
5052
5116
  tmp.textContent = "";
5053
5117
  }
5054
5118
  }
@@ -5469,15 +5533,15 @@ jQuery.event = {
5469
5533
 
5470
5534
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5471
5535
 
5472
- // Don't check non-elements (#13208)
5473
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5536
+ // Don't check non-elements (trac-13208)
5537
+ // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
5474
5538
  if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5475
5539
  matchedHandlers = [];
5476
5540
  matchedSelectors = {};
5477
5541
  for ( i = 0; i < delegateCount; i++ ) {
5478
5542
  handleObj = handlers[ i ];
5479
5543
 
5480
- // Don't conflict with Object.prototype properties (#13203)
5544
+ // Don't conflict with Object.prototype properties (trac-13203)
5481
5545
  sel = handleObj.selector + " ";
5482
5546
 
5483
5547
  if ( matchedSelectors[ sel ] === undefined ) {
@@ -5731,7 +5795,7 @@ jQuery.Event = function( src, props ) {
5731
5795
 
5732
5796
  // Create target properties
5733
5797
  // Support: Safari <=6 - 7 only
5734
- // Target should not be a text node (#504, #13143)
5798
+ // Target should not be a text node (trac-504, trac-13143)
5735
5799
  this.target = ( src.target && src.target.nodeType === 3 ) ?
5736
5800
  src.target.parentNode :
5737
5801
  src.target;
@@ -5854,10 +5918,10 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
5854
5918
  return true;
5855
5919
  },
5856
5920
 
5857
- // Suppress native focus or blur as it's already being fired
5858
- // in leverageNative.
5859
- _default: function() {
5860
- return true;
5921
+ // Suppress native focus or blur if we're currently inside
5922
+ // a leveraged native-event stack
5923
+ _default: function( event ) {
5924
+ return dataPriv.get( event.target, type );
5861
5925
  },
5862
5926
 
5863
5927
  delegateType: delegateType
@@ -5956,7 +6020,8 @@ var
5956
6020
 
5957
6021
  // checked="checked" or checked
5958
6022
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5959
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
6023
+
6024
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5960
6025
 
5961
6026
  // Prefer a tbody over its parent table for containing new rows
5962
6027
  function manipulationTarget( elem, content ) {
@@ -6070,7 +6135,7 @@ function domManip( collection, args, callback, ignored ) {
6070
6135
 
6071
6136
  // Use the original fragment for the last item
6072
6137
  // instead of the first because it can end up
6073
- // being emptied incorrectly in certain situations (#8070).
6138
+ // being emptied incorrectly in certain situations (trac-8070).
6074
6139
  for ( ; i < l; i++ ) {
6075
6140
  node = fragment;
6076
6141
 
@@ -6111,6 +6176,12 @@ function domManip( collection, args, callback, ignored ) {
6111
6176
  }, doc );
6112
6177
  }
6113
6178
  } else {
6179
+
6180
+ // Unwrap a CDATA section containing script contents. This shouldn't be
6181
+ // needed as in XML documents they're already not visible when
6182
+ // inspecting element contents and in HTML documents they have no
6183
+ // meaning but we're preserving that logic for backwards compatibility.
6184
+ // This will be removed completely in 4.0. See gh-4904.
6114
6185
  DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6115
6186
  }
6116
6187
  }
@@ -6393,9 +6464,12 @@ jQuery.each( {
6393
6464
  } );
6394
6465
  var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6395
6466
 
6467
+ var rcustomProp = /^--/;
6468
+
6469
+
6396
6470
  var getStyles = function( elem ) {
6397
6471
 
6398
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6472
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6399
6473
  // IE throws on elements created in popups
6400
6474
  // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6401
6475
  var view = elem.ownerDocument.defaultView;
@@ -6430,6 +6504,15 @@ var swap = function( elem, options, callback ) {
6430
6504
 
6431
6505
  var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6432
6506
 
6507
+ var whitespace = "[\\x20\\t\\r\\n\\f]";
6508
+
6509
+
6510
+ var rtrimCSS = new RegExp(
6511
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6512
+ "g"
6513
+ );
6514
+
6515
+
6433
6516
 
6434
6517
 
6435
6518
  ( function() {
@@ -6495,7 +6578,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6495
6578
  }
6496
6579
 
6497
6580
  // Support: IE <=9 - 11 only
6498
- // Style of cloned element affects source element cloned (#8908)
6581
+ // Style of cloned element affects source element cloned (trac-8908)
6499
6582
  div.style.backgroundClip = "content-box";
6500
6583
  div.cloneNode( true ).style.backgroundClip = "";
6501
6584
  support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6575,6 +6658,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6575
6658
 
6576
6659
  function curCSS( elem, name, computed ) {
6577
6660
  var width, minWidth, maxWidth, ret,
6661
+ isCustomProp = rcustomProp.test( name ),
6578
6662
 
6579
6663
  // Support: Firefox 51+
6580
6664
  // Retrieving style before computed somehow
@@ -6585,11 +6669,42 @@ function curCSS( elem, name, computed ) {
6585
6669
  computed = computed || getStyles( elem );
6586
6670
 
6587
6671
  // getPropertyValue is needed for:
6588
- // .css('filter') (IE 9 only, #12537)
6589
- // .css('--customProperty) (#3144)
6672
+ // .css('filter') (IE 9 only, trac-12537)
6673
+ // .css('--customProperty) (gh-3144)
6590
6674
  if ( computed ) {
6675
+
6676
+ // Support: IE <=9 - 11+
6677
+ // IE only supports `"float"` in `getPropertyValue`; in computed styles
6678
+ // it's only available as `"cssFloat"`. We no longer modify properties
6679
+ // sent to `.css()` apart from camelCasing, so we need to check both.
6680
+ // Normally, this would create difference in behavior: if
6681
+ // `getPropertyValue` returns an empty string, the value returned
6682
+ // by `.css()` would be `undefined`. This is usually the case for
6683
+ // disconnected elements. However, in IE even disconnected elements
6684
+ // with no styles return `"none"` for `getPropertyValue( "float" )`
6591
6685
  ret = computed.getPropertyValue( name ) || computed[ name ];
6592
6686
 
6687
+ if ( isCustomProp && ret ) {
6688
+
6689
+ // Support: Firefox 105+, Chrome <=105+
6690
+ // Spec requires trimming whitespace for custom properties (gh-4926).
6691
+ // Firefox only trims leading whitespace. Chrome just collapses
6692
+ // both leading & trailing whitespace to a single space.
6693
+ //
6694
+ // Fall back to `undefined` if empty string returned.
6695
+ // This collapses a missing definition with property defined
6696
+ // and set to an empty string but there's no standard API
6697
+ // allowing us to differentiate them without a performance penalty
6698
+ // and returning `undefined` aligns with older jQuery.
6699
+ //
6700
+ // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
6701
+ // as whitespace while CSS does not, but this is not a problem
6702
+ // because CSS preprocessing replaces them with U+000A LINE FEED
6703
+ // (which *is* CSS whitespace)
6704
+ // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
6705
+ ret = ret.replace( rtrimCSS, "$1" ) || undefined;
6706
+ }
6707
+
6593
6708
  if ( ret === "" && !isAttached( elem ) ) {
6594
6709
  ret = jQuery.style( elem, name );
6595
6710
  }
@@ -6685,7 +6800,6 @@ var
6685
6800
  // except "table", "table-cell", or "table-caption"
6686
6801
  // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6687
6802
  rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6688
- rcustomProp = /^--/,
6689
6803
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6690
6804
  cssNormalTransform = {
6691
6805
  letterSpacing: "0",
@@ -6921,15 +7035,15 @@ jQuery.extend( {
6921
7035
  if ( value !== undefined ) {
6922
7036
  type = typeof value;
6923
7037
 
6924
- // Convert "+=" or "-=" to relative numbers (#7345)
7038
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
6925
7039
  if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6926
7040
  value = adjustCSS( elem, name, ret );
6927
7041
 
6928
- // Fixes bug #9237
7042
+ // Fixes bug trac-9237
6929
7043
  type = "number";
6930
7044
  }
6931
7045
 
6932
- // Make sure that null and NaN values aren't set (#7116)
7046
+ // Make sure that null and NaN values aren't set (trac-7116)
6933
7047
  if ( value == null || value !== value ) {
6934
7048
  return;
6935
7049
  }
@@ -7149,7 +7263,6 @@ jQuery.fn.extend( {
7149
7263
 
7150
7264
 
7151
7265
  // Based off of the plugin by Clint Helfers, with permission.
7152
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7153
7266
  jQuery.fn.delay = function( time, type ) {
7154
7267
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7155
7268
  type = type || "fx";
@@ -7374,8 +7487,7 @@ jQuery.extend( {
7374
7487
  // Support: IE <=9 - 11 only
7375
7488
  // elem.tabIndex doesn't always return the
7376
7489
  // correct value when it hasn't been explicitly set
7377
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7378
- // Use proper attribute retrieval(#12072)
7490
+ // Use proper attribute retrieval (trac-12072)
7379
7491
  var tabindex = jQuery.find.attr( elem, "tabindex" );
7380
7492
 
7381
7493
  if ( tabindex ) {
@@ -7479,8 +7591,7 @@ function classesToArray( value ) {
7479
7591
 
7480
7592
  jQuery.fn.extend( {
7481
7593
  addClass: function( value ) {
7482
- var classes, elem, cur, curValue, clazz, j, finalValue,
7483
- i = 0;
7594
+ var classNames, cur, curValue, className, i, finalValue;
7484
7595
 
7485
7596
  if ( isFunction( value ) ) {
7486
7597
  return this.each( function( j ) {
@@ -7488,36 +7599,35 @@ jQuery.fn.extend( {
7488
7599
  } );
7489
7600
  }
7490
7601
 
7491
- classes = classesToArray( value );
7602
+ classNames = classesToArray( value );
7492
7603
 
7493
- if ( classes.length ) {
7494
- while ( ( elem = this[ i++ ] ) ) {
7495
- curValue = getClass( elem );
7496
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7604
+ if ( classNames.length ) {
7605
+ return this.each( function() {
7606
+ curValue = getClass( this );
7607
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7497
7608
 
7498
7609
  if ( cur ) {
7499
- j = 0;
7500
- while ( ( clazz = classes[ j++ ] ) ) {
7501
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
7502
- cur += clazz + " ";
7610
+ for ( i = 0; i < classNames.length; i++ ) {
7611
+ className = classNames[ i ];
7612
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
7613
+ cur += className + " ";
7503
7614
  }
7504
7615
  }
7505
7616
 
7506
7617
  // Only assign if different to avoid unneeded rendering.
7507
7618
  finalValue = stripAndCollapse( cur );
7508
7619
  if ( curValue !== finalValue ) {
7509
- elem.setAttribute( "class", finalValue );
7620
+ this.setAttribute( "class", finalValue );
7510
7621
  }
7511
7622
  }
7512
- }
7623
+ } );
7513
7624
  }
7514
7625
 
7515
7626
  return this;
7516
7627
  },
7517
7628
 
7518
7629
  removeClass: function( value ) {
7519
- var classes, elem, cur, curValue, clazz, j, finalValue,
7520
- i = 0;
7630
+ var classNames, cur, curValue, className, i, finalValue;
7521
7631
 
7522
7632
  if ( isFunction( value ) ) {
7523
7633
  return this.each( function( j ) {
@@ -7529,45 +7639,42 @@ jQuery.fn.extend( {
7529
7639
  return this.attr( "class", "" );
7530
7640
  }
7531
7641
 
7532
- classes = classesToArray( value );
7642
+ classNames = classesToArray( value );
7533
7643
 
7534
- if ( classes.length ) {
7535
- while ( ( elem = this[ i++ ] ) ) {
7536
- curValue = getClass( elem );
7644
+ if ( classNames.length ) {
7645
+ return this.each( function() {
7646
+ curValue = getClass( this );
7537
7647
 
7538
7648
  // This expression is here for better compressibility (see addClass)
7539
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7649
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7540
7650
 
7541
7651
  if ( cur ) {
7542
- j = 0;
7543
- while ( ( clazz = classes[ j++ ] ) ) {
7652
+ for ( i = 0; i < classNames.length; i++ ) {
7653
+ className = classNames[ i ];
7544
7654
 
7545
7655
  // Remove *all* instances
7546
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
7547
- cur = cur.replace( " " + clazz + " ", " " );
7656
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
7657
+ cur = cur.replace( " " + className + " ", " " );
7548
7658
  }
7549
7659
  }
7550
7660
 
7551
7661
  // Only assign if different to avoid unneeded rendering.
7552
7662
  finalValue = stripAndCollapse( cur );
7553
7663
  if ( curValue !== finalValue ) {
7554
- elem.setAttribute( "class", finalValue );
7664
+ this.setAttribute( "class", finalValue );
7555
7665
  }
7556
7666
  }
7557
- }
7667
+ } );
7558
7668
  }
7559
7669
 
7560
7670
  return this;
7561
7671
  },
7562
7672
 
7563
7673
  toggleClass: function( value, stateVal ) {
7564
- var type = typeof value,
7674
+ var classNames, className, i, self,
7675
+ type = typeof value,
7565
7676
  isValidValue = type === "string" || Array.isArray( value );
7566
7677
 
7567
- if ( typeof stateVal === "boolean" && isValidValue ) {
7568
- return stateVal ? this.addClass( value ) : this.removeClass( value );
7569
- }
7570
-
7571
7678
  if ( isFunction( value ) ) {
7572
7679
  return this.each( function( i ) {
7573
7680
  jQuery( this ).toggleClass(
@@ -7577,17 +7684,20 @@ jQuery.fn.extend( {
7577
7684
  } );
7578
7685
  }
7579
7686
 
7580
- return this.each( function() {
7581
- var className, i, self, classNames;
7687
+ if ( typeof stateVal === "boolean" && isValidValue ) {
7688
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
7689
+ }
7690
+
7691
+ classNames = classesToArray( value );
7582
7692
 
7693
+ return this.each( function() {
7583
7694
  if ( isValidValue ) {
7584
7695
 
7585
7696
  // Toggle individual class names
7586
- i = 0;
7587
7697
  self = jQuery( this );
7588
- classNames = classesToArray( value );
7589
7698
 
7590
- while ( ( className = classNames[ i++ ] ) ) {
7699
+ for ( i = 0; i < classNames.length; i++ ) {
7700
+ className = classNames[ i ];
7591
7701
 
7592
7702
  // Check each className given, space separated list
7593
7703
  if ( self.hasClass( className ) ) {
@@ -7721,7 +7831,7 @@ jQuery.extend( {
7721
7831
  val :
7722
7832
 
7723
7833
  // Support: IE <=10 - 11 only
7724
- // option.text throws exceptions (#14686, #14858)
7834
+ // option.text throws exceptions (trac-14686, trac-14858)
7725
7835
  // Strip and collapse whitespace
7726
7836
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7727
7837
  stripAndCollapse( jQuery.text( elem ) );
@@ -7748,7 +7858,7 @@ jQuery.extend( {
7748
7858
  option = options[ i ];
7749
7859
 
7750
7860
  // Support: IE <=9 only
7751
- // IE8-9 doesn't update selected after form reset (#2551)
7861
+ // IE8-9 doesn't update selected after form reset (trac-2551)
7752
7862
  if ( ( option.selected || i === index ) &&
7753
7863
 
7754
7864
  // Don't return options that are disabled or in a disabled optgroup
@@ -7891,8 +8001,8 @@ jQuery.extend( jQuery.event, {
7891
8001
  return;
7892
8002
  }
7893
8003
 
7894
- // Determine event propagation path in advance, per W3C events spec (#9951)
7895
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8004
+ // Determine event propagation path in advance, per W3C events spec (trac-9951)
8005
+ // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
7896
8006
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
7897
8007
 
7898
8008
  bubbleType = special.delegateType || type;
@@ -7944,7 +8054,7 @@ jQuery.extend( jQuery.event, {
7944
8054
  acceptData( elem ) ) {
7945
8055
 
7946
8056
  // Call a native DOM method on the target with the same name as the event.
7947
- // Don't do default actions on window, that's where global variables be (#6170)
8057
+ // Don't do default actions on window, that's where global variables be (trac-6170)
7948
8058
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
7949
8059
 
7950
8060
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -8654,7 +8764,9 @@ jQuery.each(
8654
8764
 
8655
8765
  // Support: Android <=4.0 only
8656
8766
  // Make sure we trim BOM and NBSP
8657
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
8767
+ // Require that the "whitespace run" starts from a non-whitespace
8768
+ // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
8769
+ var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
8658
8770
 
8659
8771
  // Bind a function to a context, optionally partially applying any
8660
8772
  // arguments.
@@ -8721,7 +8833,7 @@ jQuery.isNumeric = function( obj ) {
8721
8833
  jQuery.trim = function( text ) {
8722
8834
  return text == null ?
8723
8835
  "" :
8724
- ( text + "" ).replace( rtrim, "" );
8836
+ ( text + "" ).replace( rtrim, "$1" );
8725
8837
  };
8726
8838
 
8727
8839
 
@@ -8769,8 +8881,8 @@ jQuery.noConflict = function( deep ) {
8769
8881
  };
8770
8882
 
8771
8883
  // Expose jQuery and $ identifiers, even in AMD
8772
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
8773
- // and CommonJS for browser emulators (#13566)
8884
+ // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
8885
+ // and CommonJS for browser emulators (trac-13566)
8774
8886
  if ( typeof noGlobal === "undefined" ) {
8775
8887
  window.jQuery = window.$ = jQuery;
8776
8888
  }