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
2
+ * jQuery JavaScript Library v3.6.3
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",
154
+ version = "3.6.3",
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
  }
@@ -7553,7 +7667,7 @@ function Animation( elem, properties, options ) {
7553
7667
  remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7554
7668
 
7555
7669
  // Support: Android 2.3 only
7556
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7670
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
7557
7671
  temp = remaining / animation.duration || 0,
7558
7672
  percent = 1 - temp,
7559
7673
  index = 0,
@@ -7943,7 +8057,6 @@ jQuery.fx.speeds = {
7943
8057
 
7944
8058
 
7945
8059
  // 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
8060
  jQuery.fn.delay = function( time, type ) {
7948
8061
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7949
8062
  type = type || "fx";
@@ -8168,8 +8281,7 @@ jQuery.extend( {
8168
8281
  // Support: IE <=9 - 11 only
8169
8282
  // elem.tabIndex doesn't always return the
8170
8283
  // 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)
8284
+ // Use proper attribute retrieval (trac-12072)
8173
8285
  var tabindex = jQuery.find.attr( elem, "tabindex" );
8174
8286
 
8175
8287
  if ( tabindex ) {
@@ -8273,8 +8385,7 @@ function classesToArray( value ) {
8273
8385
 
8274
8386
  jQuery.fn.extend( {
8275
8387
  addClass: function( value ) {
8276
- var classes, elem, cur, curValue, clazz, j, finalValue,
8277
- i = 0;
8388
+ var classNames, cur, curValue, className, i, finalValue;
8278
8389
 
8279
8390
  if ( isFunction( value ) ) {
8280
8391
  return this.each( function( j ) {
@@ -8282,36 +8393,35 @@ jQuery.fn.extend( {
8282
8393
  } );
8283
8394
  }
8284
8395
 
8285
- classes = classesToArray( value );
8396
+ classNames = classesToArray( value );
8286
8397
 
8287
- if ( classes.length ) {
8288
- while ( ( elem = this[ i++ ] ) ) {
8289
- curValue = getClass( elem );
8290
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8398
+ if ( classNames.length ) {
8399
+ return this.each( function() {
8400
+ curValue = getClass( this );
8401
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8291
8402
 
8292
8403
  if ( cur ) {
8293
- j = 0;
8294
- while ( ( clazz = classes[ j++ ] ) ) {
8295
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8296
- cur += clazz + " ";
8404
+ for ( i = 0; i < classNames.length; i++ ) {
8405
+ className = classNames[ i ];
8406
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
8407
+ cur += className + " ";
8297
8408
  }
8298
8409
  }
8299
8410
 
8300
8411
  // Only assign if different to avoid unneeded rendering.
8301
8412
  finalValue = stripAndCollapse( cur );
8302
8413
  if ( curValue !== finalValue ) {
8303
- elem.setAttribute( "class", finalValue );
8414
+ this.setAttribute( "class", finalValue );
8304
8415
  }
8305
8416
  }
8306
- }
8417
+ } );
8307
8418
  }
8308
8419
 
8309
8420
  return this;
8310
8421
  },
8311
8422
 
8312
8423
  removeClass: function( value ) {
8313
- var classes, elem, cur, curValue, clazz, j, finalValue,
8314
- i = 0;
8424
+ var classNames, cur, curValue, className, i, finalValue;
8315
8425
 
8316
8426
  if ( isFunction( value ) ) {
8317
8427
  return this.each( function( j ) {
@@ -8323,45 +8433,42 @@ jQuery.fn.extend( {
8323
8433
  return this.attr( "class", "" );
8324
8434
  }
8325
8435
 
8326
- classes = classesToArray( value );
8436
+ classNames = classesToArray( value );
8327
8437
 
8328
- if ( classes.length ) {
8329
- while ( ( elem = this[ i++ ] ) ) {
8330
- curValue = getClass( elem );
8438
+ if ( classNames.length ) {
8439
+ return this.each( function() {
8440
+ curValue = getClass( this );
8331
8441
 
8332
8442
  // This expression is here for better compressibility (see addClass)
8333
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8443
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8334
8444
 
8335
8445
  if ( cur ) {
8336
- j = 0;
8337
- while ( ( clazz = classes[ j++ ] ) ) {
8446
+ for ( i = 0; i < classNames.length; i++ ) {
8447
+ className = classNames[ i ];
8338
8448
 
8339
8449
  // Remove *all* instances
8340
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8341
- cur = cur.replace( " " + clazz + " ", " " );
8450
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
8451
+ cur = cur.replace( " " + className + " ", " " );
8342
8452
  }
8343
8453
  }
8344
8454
 
8345
8455
  // Only assign if different to avoid unneeded rendering.
8346
8456
  finalValue = stripAndCollapse( cur );
8347
8457
  if ( curValue !== finalValue ) {
8348
- elem.setAttribute( "class", finalValue );
8458
+ this.setAttribute( "class", finalValue );
8349
8459
  }
8350
8460
  }
8351
- }
8461
+ } );
8352
8462
  }
8353
8463
 
8354
8464
  return this;
8355
8465
  },
8356
8466
 
8357
8467
  toggleClass: function( value, stateVal ) {
8358
- var type = typeof value,
8468
+ var classNames, className, i, self,
8469
+ type = typeof value,
8359
8470
  isValidValue = type === "string" || Array.isArray( value );
8360
8471
 
8361
- if ( typeof stateVal === "boolean" && isValidValue ) {
8362
- return stateVal ? this.addClass( value ) : this.removeClass( value );
8363
- }
8364
-
8365
8472
  if ( isFunction( value ) ) {
8366
8473
  return this.each( function( i ) {
8367
8474
  jQuery( this ).toggleClass(
@@ -8371,17 +8478,20 @@ jQuery.fn.extend( {
8371
8478
  } );
8372
8479
  }
8373
8480
 
8374
- return this.each( function() {
8375
- var className, i, self, classNames;
8481
+ if ( typeof stateVal === "boolean" && isValidValue ) {
8482
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
8483
+ }
8484
+
8485
+ classNames = classesToArray( value );
8376
8486
 
8487
+ return this.each( function() {
8377
8488
  if ( isValidValue ) {
8378
8489
 
8379
8490
  // Toggle individual class names
8380
- i = 0;
8381
8491
  self = jQuery( this );
8382
- classNames = classesToArray( value );
8383
8492
 
8384
- while ( ( className = classNames[ i++ ] ) ) {
8493
+ for ( i = 0; i < classNames.length; i++ ) {
8494
+ className = classNames[ i ];
8385
8495
 
8386
8496
  // Check each className given, space separated list
8387
8497
  if ( self.hasClass( className ) ) {
@@ -8515,7 +8625,7 @@ jQuery.extend( {
8515
8625
  val :
8516
8626
 
8517
8627
  // Support: IE <=10 - 11 only
8518
- // option.text throws exceptions (#14686, #14858)
8628
+ // option.text throws exceptions (trac-14686, trac-14858)
8519
8629
  // Strip and collapse whitespace
8520
8630
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8521
8631
  stripAndCollapse( jQuery.text( elem ) );
@@ -8542,7 +8652,7 @@ jQuery.extend( {
8542
8652
  option = options[ i ];
8543
8653
 
8544
8654
  // Support: IE <=9 only
8545
- // IE8-9 doesn't update selected after form reset (#2551)
8655
+ // IE8-9 doesn't update selected after form reset (trac-2551)
8546
8656
  if ( ( option.selected || i === index ) &&
8547
8657
 
8548
8658
  // Don't return options that are disabled or in a disabled optgroup
@@ -8685,8 +8795,8 @@ jQuery.extend( jQuery.event, {
8685
8795
  return;
8686
8796
  }
8687
8797
 
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)
8798
+ // Determine event propagation path in advance, per W3C events spec (trac-9951)
8799
+ // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
8690
8800
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8691
8801
 
8692
8802
  bubbleType = special.delegateType || type;
@@ -8738,7 +8848,7 @@ jQuery.extend( jQuery.event, {
8738
8848
  acceptData( elem ) ) {
8739
8849
 
8740
8850
  // 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)
8851
+ // Don't do default actions on window, that's where global variables be (trac-6170)
8742
8852
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8743
8853
 
8744
8854
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -9012,7 +9122,7 @@ var
9012
9122
  rantiCache = /([?&])_=[^&]*/,
9013
9123
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
9014
9124
 
9015
- // #7653, #8125, #8152: local protocol detection
9125
+ // trac-7653, trac-8125, trac-8152: local protocol detection
9016
9126
  rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
9017
9127
  rnoContent = /^(?:GET|HEAD)$/,
9018
9128
  rprotocol = /^\/\//,
@@ -9035,7 +9145,7 @@ var
9035
9145
  */
9036
9146
  transports = {},
9037
9147
 
9038
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
9148
+ // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
9039
9149
  allTypes = "*/".concat( "*" ),
9040
9150
 
9041
9151
  // Anchor tag for parsing the document origin
@@ -9106,7 +9216,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
9106
9216
 
9107
9217
  // A special extend for ajax options
9108
9218
  // that takes "flat" options (not to be deep extended)
9109
- // Fixes #9887
9219
+ // Fixes trac-9887
9110
9220
  function ajaxExtend( target, src ) {
9111
9221
  var key, deep,
9112
9222
  flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9517,12 +9627,12 @@ jQuery.extend( {
9517
9627
  deferred.promise( jqXHR );
9518
9628
 
9519
9629
  // Add protocol if not provided (prefilters might expect it)
9520
- // Handle falsy url in the settings object (#10093: consistency with old signature)
9630
+ // Handle falsy url in the settings object (trac-10093: consistency with old signature)
9521
9631
  // We also use the url parameter if available
9522
9632
  s.url = ( ( url || s.url || location.href ) + "" )
9523
9633
  .replace( rprotocol, location.protocol + "//" );
9524
9634
 
9525
- // Alias method option to type as per ticket #12004
9635
+ // Alias method option to type as per ticket trac-12004
9526
9636
  s.type = options.method || options.type || s.method || s.type;
9527
9637
 
9528
9638
  // Extract dataTypes list
@@ -9565,7 +9675,7 @@ jQuery.extend( {
9565
9675
  }
9566
9676
 
9567
9677
  // 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)
9678
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
9569
9679
  fireGlobals = jQuery.event && s.global;
9570
9680
 
9571
9681
  // Watch for a new set of requests
@@ -9594,7 +9704,7 @@ jQuery.extend( {
9594
9704
  if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9595
9705
  cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9596
9706
 
9597
- // #9682: remove data so that it's not used in an eventual retry
9707
+ // trac-9682: remove data so that it's not used in an eventual retry
9598
9708
  delete s.data;
9599
9709
  }
9600
9710
 
@@ -9867,7 +9977,7 @@ jQuery._evalUrl = function( url, options, doc ) {
9867
9977
  return jQuery.ajax( {
9868
9978
  url: url,
9869
9979
 
9870
- // Make this explicit, since user can override this through ajaxSetup (#11264)
9980
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
9871
9981
  type: "GET",
9872
9982
  dataType: "script",
9873
9983
  cache: true,
@@ -9976,7 +10086,7 @@ var xhrSuccessStatus = {
9976
10086
  0: 200,
9977
10087
 
9978
10088
  // Support: IE <=9 only
9979
- // #1450: sometimes IE returns 1223 when it should be 204
10089
+ // trac-1450: sometimes IE returns 1223 when it should be 204
9980
10090
  1223: 204
9981
10091
  },
9982
10092
  xhrSupported = jQuery.ajaxSettings.xhr();
@@ -10048,7 +10158,7 @@ jQuery.ajaxTransport( function( options ) {
10048
10158
  } else {
10049
10159
  complete(
10050
10160
 
10051
- // File: protocol always yields status 0; see #8605, #14207
10161
+ // File: protocol always yields status 0; see trac-8605, trac-14207
10052
10162
  xhr.status,
10053
10163
  xhr.statusText
10054
10164
  );
@@ -10109,7 +10219,7 @@ jQuery.ajaxTransport( function( options ) {
10109
10219
  xhr.send( options.hasContent && options.data || null );
10110
10220
  } catch ( e ) {
10111
10221
 
10112
- // #14683: Only rethrow if this hasn't been notified as an error yet
10222
+ // trac-14683: Only rethrow if this hasn't been notified as an error yet
10113
10223
  if ( callback ) {
10114
10224
  throw e;
10115
10225
  }
@@ -10753,7 +10863,9 @@ jQuery.each(
10753
10863
 
10754
10864
  // Support: Android <=4.0 only
10755
10865
  // Make sure we trim BOM and NBSP
10756
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
10866
+ // Require that the "whitespace run" starts from a non-whitespace
10867
+ // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
10868
+ var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
10757
10869
 
10758
10870
  // Bind a function to a context, optionally partially applying any
10759
10871
  // arguments.
@@ -10820,7 +10932,7 @@ jQuery.isNumeric = function( obj ) {
10820
10932
  jQuery.trim = function( text ) {
10821
10933
  return text == null ?
10822
10934
  "" :
10823
- ( text + "" ).replace( rtrim, "" );
10935
+ ( text + "" ).replace( rtrim, "$1" );
10824
10936
  };
10825
10937
 
10826
10938
 
@@ -10868,8 +10980,8 @@ jQuery.noConflict = function( deep ) {
10868
10980
  };
10869
10981
 
10870
10982
  // 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)
10983
+ // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
10984
+ // and CommonJS for browser emulators (trac-13566)
10873
10985
  if ( typeof noGlobal === "undefined" ) {
10874
10986
  window.jQuery = window.$ = jQuery;
10875
10987
  }