pghero 3.1.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/app/assets/javascripts/pghero/Chart.bundle.js +23379 -19766
  4. data/app/assets/javascripts/pghero/application.js +13 -12
  5. data/app/assets/javascripts/pghero/chartkick.js +834 -764
  6. data/app/assets/javascripts/pghero/highlight.min.js +440 -0
  7. data/app/assets/javascripts/pghero/jquery.js +318 -197
  8. data/app/assets/javascripts/pghero/nouislider.js +676 -1066
  9. data/app/assets/stylesheets/pghero/application.css +8 -2
  10. data/app/assets/stylesheets/pghero/nouislider.css +4 -10
  11. data/app/controllers/pg_hero/home_controller.rb +31 -9
  12. data/app/helpers/pg_hero/home_helper.rb +2 -2
  13. data/app/views/layouts/pg_hero/application.html.erb +1 -1
  14. data/app/views/pg_hero/home/_query_stats_slider.html.erb +6 -6
  15. data/app/views/pg_hero/home/connections.html.erb +6 -6
  16. data/app/views/pg_hero/home/index.html.erb +3 -1
  17. data/app/views/pg_hero/home/queries.html.erb +4 -2
  18. data/app/views/pg_hero/home/relation_space.html.erb +1 -1
  19. data/app/views/pg_hero/home/show_query.html.erb +16 -12
  20. data/app/views/pg_hero/home/space.html.erb +44 -40
  21. data/app/views/pg_hero/home/system.html.erb +6 -6
  22. data/lib/generators/pghero/query_stats_generator.rb +1 -0
  23. data/lib/generators/pghero/space_stats_generator.rb +1 -0
  24. data/lib/pghero/engine.rb +1 -1
  25. data/lib/pghero/methods/basic.rb +5 -8
  26. data/lib/pghero/methods/connections.rb +4 -4
  27. data/lib/pghero/methods/constraints.rb +1 -1
  28. data/lib/pghero/methods/indexes.rb +8 -8
  29. data/lib/pghero/methods/kill.rb +1 -1
  30. data/lib/pghero/methods/maintenance.rb +3 -3
  31. data/lib/pghero/methods/queries.rb +2 -2
  32. data/lib/pghero/methods/query_stats.rb +19 -19
  33. data/lib/pghero/methods/replication.rb +2 -2
  34. data/lib/pghero/methods/sequences.rb +2 -2
  35. data/lib/pghero/methods/space.rb +18 -12
  36. data/lib/pghero/methods/suggested_indexes.rb +10 -6
  37. data/lib/pghero/methods/tables.rb +4 -5
  38. data/lib/pghero/version.rb +1 -1
  39. data/lib/pghero.rb +28 -26
  40. data/lib/tasks/pghero.rake +11 -1
  41. data/licenses/LICENSE-chart.js.txt +1 -1
  42. data/licenses/LICENSE-date-fns.txt +21 -20
  43. data/licenses/LICENSE-kurkle-color.txt +9 -0
  44. metadata +5 -4
  45. data/app/assets/javascripts/pghero/highlight.pack.js +0 -2
@@ -1,15 +1,15 @@
1
1
  /*!
2
- * jQuery JavaScript Library v3.5.1
2
+ * jQuery JavaScript Library v3.6.3
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-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 ) {
@@ -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.3",
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.9
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: 2022-12-19
529
533
  */
530
534
  ( function( window ) {
531
535
  var i,
@@ -875,6 +879,27 @@ function Sizzle( selector, context, results, seed ) {
875
879
  }
876
880
 
877
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
+
878
903
  push.apply( results,
879
904
  newContext.querySelectorAll( newSelector )
880
905
  );
@@ -1108,8 +1133,8 @@ support = Sizzle.support = {};
1108
1133
  * @returns {Boolean} True iff elem is a non-HTML XML node
1109
1134
  */
1110
1135
  isXML = Sizzle.isXML = function( elem ) {
1111
- var namespace = elem.namespaceURI,
1112
- docElem = ( elem.ownerDocument || elem ).documentElement;
1136
+ var namespace = elem && elem.namespaceURI,
1137
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;
1113
1138
 
1114
1139
  // Support: IE <=8
1115
1140
  // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
@@ -1170,6 +1195,31 @@ setDocument = Sizzle.setDocument = function( node ) {
1170
1195
  !el.querySelectorAll( ":scope fieldset div" ).length;
1171
1196
  } );
1172
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
+
1173
1223
  /* Attributes
1174
1224
  ---------------------------------------------------------------------- */
1175
1225
 
@@ -1436,6 +1486,17 @@ setDocument = Sizzle.setDocument = function( node ) {
1436
1486
  } );
1437
1487
  }
1438
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
+
1439
1500
  rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
1440
1501
  rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
1441
1502
 
@@ -1448,7 +1509,14 @@ setDocument = Sizzle.setDocument = function( node ) {
1448
1509
  // As in, an element does not contain itself
1449
1510
  contains = hasCompare || rnative.test( docElem.contains ) ?
1450
1511
  function( a, b ) {
1451
- 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,
1452
1520
  bup = b && b.parentNode;
1453
1521
  return a === bup || !!( bup && bup.nodeType === 1 && (
1454
1522
  adown.contains ?
@@ -2238,7 +2306,7 @@ Expr = Sizzle.selectors = {
2238
2306
  return elem.nodeName.toLowerCase() === "input" &&
2239
2307
  elem.type === "text" &&
2240
2308
 
2241
- // Support: IE<8
2309
+ // Support: IE <10 only
2242
2310
  // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2243
2311
  ( ( attr = elem.getAttribute( "type" ) ) == null ||
2244
2312
  attr.toLowerCase() === "text" );
@@ -3024,9 +3092,9 @@ var rneedsContext = jQuery.expr.match.needsContext;
3024
3092
 
3025
3093
  function nodeName( elem, name ) {
3026
3094
 
3027
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3095
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3028
3096
 
3029
- };
3097
+ }
3030
3098
  var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
3031
3099
 
3032
3100
 
@@ -3125,8 +3193,8 @@ jQuery.fn.extend( {
3125
3193
  var rootjQuery,
3126
3194
 
3127
3195
  // 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 <)
3196
+ // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
3197
+ // Strict HTML recognition (trac-11290: must start with <)
3130
3198
  // Shortcut simple #id case for speed
3131
3199
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3132
3200
 
@@ -3997,8 +4065,8 @@ jQuery.extend( {
3997
4065
  resolveContexts = Array( i ),
3998
4066
  resolveValues = slice.call( arguments ),
3999
4067
 
4000
- // the master Deferred
4001
- master = jQuery.Deferred(),
4068
+ // the primary Deferred
4069
+ primary = jQuery.Deferred(),
4002
4070
 
4003
4071
  // subordinate callback factory
4004
4072
  updateFunc = function( i ) {
@@ -4006,30 +4074,30 @@ jQuery.extend( {
4006
4074
  resolveContexts[ i ] = this;
4007
4075
  resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
4008
4076
  if ( !( --remaining ) ) {
4009
- master.resolveWith( resolveContexts, resolveValues );
4077
+ primary.resolveWith( resolveContexts, resolveValues );
4010
4078
  }
4011
4079
  };
4012
4080
  };
4013
4081
 
4014
4082
  // Single- and empty arguments are adopted like Promise.resolve
4015
4083
  if ( remaining <= 1 ) {
4016
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
4084
+ adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
4017
4085
  !remaining );
4018
4086
 
4019
4087
  // Use .then() to unwrap secondary thenables (cf. gh-3000)
4020
- if ( master.state() === "pending" ||
4088
+ if ( primary.state() === "pending" ||
4021
4089
  isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
4022
4090
 
4023
- return master.then();
4091
+ return primary.then();
4024
4092
  }
4025
4093
  }
4026
4094
 
4027
4095
  // Multiple arguments are aggregated like Promise.all array elements
4028
4096
  while ( i-- ) {
4029
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
4097
+ adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
4030
4098
  }
4031
4099
 
4032
- return master.promise();
4100
+ return primary.promise();
4033
4101
  }
4034
4102
  } );
4035
4103
 
@@ -4083,7 +4151,7 @@ jQuery.extend( {
4083
4151
  isReady: false,
4084
4152
 
4085
4153
  // A counter to track how many items to wait for before
4086
- // the ready event fires. See #6781
4154
+ // the ready event fires. See trac-6781
4087
4155
  readyWait: 1,
4088
4156
 
4089
4157
  // Handle when the DOM is ready
@@ -4180,8 +4248,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4180
4248
  for ( ; i < len; i++ ) {
4181
4249
  fn(
4182
4250
  elems[ i ], key, raw ?
4183
- value :
4184
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
4251
+ value :
4252
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
4185
4253
  );
4186
4254
  }
4187
4255
  }
@@ -4211,7 +4279,7 @@ function fcamelCase( _all, letter ) {
4211
4279
 
4212
4280
  // Convert dashed to camelCase; used by the css and data modules
4213
4281
  // Support: IE <=9 - 11, Edge 12 - 15
4214
- // Microsoft forgot to hump their vendor prefix (#9572)
4282
+ // Microsoft forgot to hump their vendor prefix (trac-9572)
4215
4283
  function camelCase( string ) {
4216
4284
  return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4217
4285
  }
@@ -4247,7 +4315,7 @@ Data.prototype = {
4247
4315
  value = {};
4248
4316
 
4249
4317
  // We can accept data for non-element nodes in modern browsers,
4250
- // but we should not, see #8335.
4318
+ // but we should not, see trac-8335.
4251
4319
  // Always return an empty object.
4252
4320
  if ( acceptData( owner ) ) {
4253
4321
 
@@ -4486,7 +4554,7 @@ jQuery.fn.extend( {
4486
4554
  while ( i-- ) {
4487
4555
 
4488
4556
  // Support: IE 11 only
4489
- // The attrs elements can be null (#14894)
4557
+ // The attrs elements can be null (trac-14894)
4490
4558
  if ( attrs[ i ] ) {
4491
4559
  name = attrs[ i ].name;
4492
4560
  if ( name.indexOf( "data-" ) === 0 ) {
@@ -4909,9 +4977,9 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4909
4977
  input = document.createElement( "input" );
4910
4978
 
4911
4979
  // Support: Android 4.0 - 4.3 only
4912
- // Check state lost if the name is set (#11217)
4980
+ // Check state lost if the name is set (trac-11217)
4913
4981
  // Support: Windows Web Apps (WWA)
4914
- // `name` and `type` must use .setAttribute for WWA (#14901)
4982
+ // `name` and `type` must use .setAttribute for WWA (trac-14901)
4915
4983
  input.setAttribute( "type", "radio" );
4916
4984
  input.setAttribute( "checked", "checked" );
4917
4985
  input.setAttribute( "name", "t" );
@@ -4935,7 +5003,7 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4935
5003
  } )();
4936
5004
 
4937
5005
 
4938
- // We have to close these tags to support XHTML (#13200)
5006
+ // We have to close these tags to support XHTML (trac-13200)
4939
5007
  var wrapMap = {
4940
5008
 
4941
5009
  // XHTML parsers do not magically insert elements in the
@@ -4961,7 +5029,7 @@ if ( !support.option ) {
4961
5029
  function getAll( context, tag ) {
4962
5030
 
4963
5031
  // Support: IE <=9 - 11 only
4964
- // 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)
4965
5033
  var ret;
4966
5034
 
4967
5035
  if ( typeof context.getElementsByTagName !== "undefined" ) {
@@ -5044,7 +5112,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5044
5112
  // Remember the top-level container
5045
5113
  tmp = fragment.firstChild;
5046
5114
 
5047
- // Ensure the created nodes are orphaned (#12392)
5115
+ // Ensure the created nodes are orphaned (trac-12392)
5048
5116
  tmp.textContent = "";
5049
5117
  }
5050
5118
  }
@@ -5089,10 +5157,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
5089
5157
  }
5090
5158
 
5091
5159
 
5092
- var
5093
- rkeyEvent = /^key/,
5094
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
5095
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5160
+ var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5096
5161
 
5097
5162
  function returnTrue() {
5098
5163
  return true;
@@ -5387,8 +5452,8 @@ jQuery.event = {
5387
5452
  event = jQuery.event.fix( nativeEvent ),
5388
5453
 
5389
5454
  handlers = (
5390
- dataPriv.get( this, "events" ) || Object.create( null )
5391
- )[ event.type ] || [],
5455
+ dataPriv.get( this, "events" ) || Object.create( null )
5456
+ )[ event.type ] || [],
5392
5457
  special = jQuery.event.special[ event.type ] || {};
5393
5458
 
5394
5459
  // Use the fix-ed jQuery.Event rather than the (read-only) native event
@@ -5468,15 +5533,15 @@ jQuery.event = {
5468
5533
 
5469
5534
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5470
5535
 
5471
- // Don't check non-elements (#13208)
5472
- // 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)
5473
5538
  if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5474
5539
  matchedHandlers = [];
5475
5540
  matchedSelectors = {};
5476
5541
  for ( i = 0; i < delegateCount; i++ ) {
5477
5542
  handleObj = handlers[ i ];
5478
5543
 
5479
- // Don't conflict with Object.prototype properties (#13203)
5544
+ // Don't conflict with Object.prototype properties (trac-13203)
5480
5545
  sel = handleObj.selector + " ";
5481
5546
 
5482
5547
  if ( matchedSelectors[ sel ] === undefined ) {
@@ -5512,12 +5577,12 @@ jQuery.event = {
5512
5577
  get: isFunction( hook ) ?
5513
5578
  function() {
5514
5579
  if ( this.originalEvent ) {
5515
- return hook( this.originalEvent );
5580
+ return hook( this.originalEvent );
5516
5581
  }
5517
5582
  } :
5518
5583
  function() {
5519
5584
  if ( this.originalEvent ) {
5520
- return this.originalEvent[ name ];
5585
+ return this.originalEvent[ name ];
5521
5586
  }
5522
5587
  },
5523
5588
 
@@ -5656,7 +5721,13 @@ function leverageNative( el, type, expectSync ) {
5656
5721
  // Cancel the outer synthetic event
5657
5722
  event.stopImmediatePropagation();
5658
5723
  event.preventDefault();
5659
- return result.value;
5724
+
5725
+ // Support: Chrome 86+
5726
+ // In Chrome, if an element having a focusout handler is blurred by
5727
+ // clicking outside of it, it invokes the handler synchronously. If
5728
+ // that handler calls `.remove()` on the element, the data is cleared,
5729
+ // leaving `result` undefined. We need to guard against this.
5730
+ return result && result.value;
5660
5731
  }
5661
5732
 
5662
5733
  // If this is an inner synthetic event for an event with a bubbling surrogate
@@ -5724,7 +5795,7 @@ jQuery.Event = function( src, props ) {
5724
5795
 
5725
5796
  // Create target properties
5726
5797
  // Support: Safari <=6 - 7 only
5727
- // Target should not be a text node (#504, #13143)
5798
+ // Target should not be a text node (trac-504, trac-13143)
5728
5799
  this.target = ( src.target && src.target.nodeType === 3 ) ?
5729
5800
  src.target.parentNode :
5730
5801
  src.target;
@@ -5821,34 +5892,7 @@ jQuery.each( {
5821
5892
  targetTouches: true,
5822
5893
  toElement: true,
5823
5894
  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
- }
5895
+ which: true
5852
5896
  }, jQuery.event.addProp );
5853
5897
 
5854
5898
  jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
@@ -5874,6 +5918,12 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
5874
5918
  return true;
5875
5919
  },
5876
5920
 
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 );
5925
+ },
5926
+
5877
5927
  delegateType: delegateType
5878
5928
  };
5879
5929
  } );
@@ -5970,7 +6020,8 @@ var
5970
6020
 
5971
6021
  // checked="checked" or checked
5972
6022
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5973
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
6023
+
6024
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
5974
6025
 
5975
6026
  // Prefer a tbody over its parent table for containing new rows
5976
6027
  function manipulationTarget( elem, content ) {
@@ -6084,7 +6135,7 @@ function domManip( collection, args, callback, ignored ) {
6084
6135
 
6085
6136
  // Use the original fragment for the last item
6086
6137
  // instead of the first because it can end up
6087
- // being emptied incorrectly in certain situations (#8070).
6138
+ // being emptied incorrectly in certain situations (trac-8070).
6088
6139
  for ( ; i < l; i++ ) {
6089
6140
  node = fragment;
6090
6141
 
@@ -6125,6 +6176,12 @@ function domManip( collection, args, callback, ignored ) {
6125
6176
  }, doc );
6126
6177
  }
6127
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.
6128
6185
  DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6129
6186
  }
6130
6187
  }
@@ -6407,9 +6464,12 @@ jQuery.each( {
6407
6464
  } );
6408
6465
  var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6409
6466
 
6467
+ var rcustomProp = /^--/;
6468
+
6469
+
6410
6470
  var getStyles = function( elem ) {
6411
6471
 
6412
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6472
+ // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
6413
6473
  // IE throws on elements created in popups
6414
6474
  // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6415
6475
  var view = elem.ownerDocument.defaultView;
@@ -6444,6 +6504,15 @@ var swap = function( elem, options, callback ) {
6444
6504
 
6445
6505
  var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6446
6506
 
6507
+ var whitespace = "[\\x20\\t\\r\\n\\f]";
6508
+
6509
+
6510
+ var rtrimCSS = new RegExp(
6511
+ "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
6512
+ "g"
6513
+ );
6514
+
6515
+
6447
6516
 
6448
6517
 
6449
6518
  ( function() {
@@ -6509,7 +6578,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6509
6578
  }
6510
6579
 
6511
6580
  // Support: IE <=9 - 11 only
6512
- // Style of cloned element affects source element cloned (#8908)
6581
+ // Style of cloned element affects source element cloned (trac-8908)
6513
6582
  div.style.backgroundClip = "content-box";
6514
6583
  div.cloneNode( true ).style.backgroundClip = "";
6515
6584
  support.clearCloneStyle = div.style.backgroundClip === "content-box";
@@ -6541,6 +6610,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6541
6610
  // set in CSS while `offset*` properties report correct values.
6542
6611
  // Behavior in IE 9 is more subtle than in newer versions & it passes
6543
6612
  // some versions of this test; make sure not to make it pass there!
6613
+ //
6614
+ // Support: Firefox 70+
6615
+ // Only Firefox includes border widths
6616
+ // in computed dimensions. (gh-4529)
6544
6617
  reliableTrDimensions: function() {
6545
6618
  var table, tr, trChild, trStyle;
6546
6619
  if ( reliableTrDimensionsVal == null ) {
@@ -6548,17 +6621,32 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6548
6621
  tr = document.createElement( "tr" );
6549
6622
  trChild = document.createElement( "div" );
6550
6623
 
6551
- table.style.cssText = "position:absolute;left:-11111px";
6624
+ table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
6625
+ tr.style.cssText = "border:1px solid";
6626
+
6627
+ // Support: Chrome 86+
6628
+ // Height set through cssText does not get applied.
6629
+ // Computed height then comes back as 0.
6552
6630
  tr.style.height = "1px";
6553
6631
  trChild.style.height = "9px";
6554
6632
 
6633
+ // Support: Android 8 Chrome 86+
6634
+ // In our bodyBackground.html iframe,
6635
+ // display for all div elements is set to "inline",
6636
+ // which causes a problem only in Android 8 Chrome 86.
6637
+ // Ensuring the div is display: block
6638
+ // gets around this issue.
6639
+ trChild.style.display = "block";
6640
+
6555
6641
  documentElement
6556
6642
  .appendChild( table )
6557
6643
  .appendChild( tr )
6558
6644
  .appendChild( trChild );
6559
6645
 
6560
6646
  trStyle = window.getComputedStyle( tr );
6561
- reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
6647
+ reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
6648
+ parseInt( trStyle.borderTopWidth, 10 ) +
6649
+ parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
6562
6650
 
6563
6651
  documentElement.removeChild( table );
6564
6652
  }
@@ -6570,6 +6658,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6570
6658
 
6571
6659
  function curCSS( elem, name, computed ) {
6572
6660
  var width, minWidth, maxWidth, ret,
6661
+ isCustomProp = rcustomProp.test( name ),
6573
6662
 
6574
6663
  // Support: Firefox 51+
6575
6664
  // Retrieving style before computed somehow
@@ -6580,11 +6669,42 @@ function curCSS( elem, name, computed ) {
6580
6669
  computed = computed || getStyles( elem );
6581
6670
 
6582
6671
  // getPropertyValue is needed for:
6583
- // .css('filter') (IE 9 only, #12537)
6584
- // .css('--customProperty) (#3144)
6672
+ // .css('filter') (IE 9 only, trac-12537)
6673
+ // .css('--customProperty) (gh-3144)
6585
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" )`
6586
6685
  ret = computed.getPropertyValue( name ) || computed[ name ];
6587
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
+
6588
6708
  if ( ret === "" && !isAttached( elem ) ) {
6589
6709
  ret = jQuery.style( elem, name );
6590
6710
  }
@@ -6680,7 +6800,6 @@ var
6680
6800
  // except "table", "table-cell", or "table-caption"
6681
6801
  // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6682
6802
  rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6683
- rcustomProp = /^--/,
6684
6803
  cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6685
6804
  cssNormalTransform = {
6686
6805
  letterSpacing: "0",
@@ -6916,15 +7035,15 @@ jQuery.extend( {
6916
7035
  if ( value !== undefined ) {
6917
7036
  type = typeof value;
6918
7037
 
6919
- // Convert "+=" or "-=" to relative numbers (#7345)
7038
+ // Convert "+=" or "-=" to relative numbers (trac-7345)
6920
7039
  if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6921
7040
  value = adjustCSS( elem, name, ret );
6922
7041
 
6923
- // Fixes bug #9237
7042
+ // Fixes bug trac-9237
6924
7043
  type = "number";
6925
7044
  }
6926
7045
 
6927
- // Make sure that null and NaN values aren't set (#7116)
7046
+ // Make sure that null and NaN values aren't set (trac-7116)
6928
7047
  if ( value == null || value !== value ) {
6929
7048
  return;
6930
7049
  }
@@ -7022,10 +7141,10 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
7022
7141
  // Running getBoundingClientRect on a disconnected node
7023
7142
  // in IE throws an error.
7024
7143
  ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
7025
- swap( elem, cssShow, function() {
7026
- return getWidthOrHeight( elem, dimension, extra );
7027
- } ) :
7028
- getWidthOrHeight( elem, dimension, extra );
7144
+ swap( elem, cssShow, function() {
7145
+ return getWidthOrHeight( elem, dimension, extra );
7146
+ } ) :
7147
+ getWidthOrHeight( elem, dimension, extra );
7029
7148
  }
7030
7149
  },
7031
7150
 
@@ -7084,7 +7203,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
7084
7203
  swap( elem, { marginLeft: 0 }, function() {
7085
7204
  return elem.getBoundingClientRect().left;
7086
7205
  } )
7087
- ) + "px";
7206
+ ) + "px";
7088
7207
  }
7089
7208
  }
7090
7209
  );
@@ -7223,7 +7342,7 @@ Tween.propHooks = {
7223
7342
  if ( jQuery.fx.step[ tween.prop ] ) {
7224
7343
  jQuery.fx.step[ tween.prop ]( tween );
7225
7344
  } else if ( tween.elem.nodeType === 1 && (
7226
- jQuery.cssHooks[ tween.prop ] ||
7345
+ jQuery.cssHooks[ tween.prop ] ||
7227
7346
  tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
7228
7347
  jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7229
7348
  } else {
@@ -7468,7 +7587,7 @@ function defaultPrefilter( elem, props, opts ) {
7468
7587
 
7469
7588
  anim.done( function() {
7470
7589
 
7471
- /* eslint-enable no-loop-func */
7590
+ /* eslint-enable no-loop-func */
7472
7591
 
7473
7592
  // The final step of a "hide" animation is actually hiding the element
7474
7593
  if ( !hidden ) {
@@ -7548,7 +7667,7 @@ function Animation( elem, properties, options ) {
7548
7667
  remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7549
7668
 
7550
7669
  // Support: Android 2.3 only
7551
- // 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)
7552
7671
  temp = remaining / animation.duration || 0,
7553
7672
  percent = 1 - temp,
7554
7673
  index = 0,
@@ -7588,7 +7707,7 @@ function Animation( elem, properties, options ) {
7588
7707
  tweens: [],
7589
7708
  createTween: function( prop, end ) {
7590
7709
  var tween = jQuery.Tween( elem, animation.opts, prop, end,
7591
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
7710
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
7592
7711
  animation.tweens.push( tween );
7593
7712
  return tween;
7594
7713
  },
@@ -7761,7 +7880,8 @@ jQuery.fn.extend( {
7761
7880
  anim.stop( true );
7762
7881
  }
7763
7882
  };
7764
- doAnimation.finish = doAnimation;
7883
+
7884
+ doAnimation.finish = doAnimation;
7765
7885
 
7766
7886
  return empty || optall.queue === false ?
7767
7887
  this.each( doAnimation ) :
@@ -7937,7 +8057,6 @@ jQuery.fx.speeds = {
7937
8057
 
7938
8058
 
7939
8059
  // 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
8060
  jQuery.fn.delay = function( time, type ) {
7942
8061
  time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7943
8062
  type = type || "fx";
@@ -8162,8 +8281,7 @@ jQuery.extend( {
8162
8281
  // Support: IE <=9 - 11 only
8163
8282
  // elem.tabIndex doesn't always return the
8164
8283
  // 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)
8284
+ // Use proper attribute retrieval (trac-12072)
8167
8285
  var tabindex = jQuery.find.attr( elem, "tabindex" );
8168
8286
 
8169
8287
  if ( tabindex ) {
@@ -8267,8 +8385,7 @@ function classesToArray( value ) {
8267
8385
 
8268
8386
  jQuery.fn.extend( {
8269
8387
  addClass: function( value ) {
8270
- var classes, elem, cur, curValue, clazz, j, finalValue,
8271
- i = 0;
8388
+ var classNames, cur, curValue, className, i, finalValue;
8272
8389
 
8273
8390
  if ( isFunction( value ) ) {
8274
8391
  return this.each( function( j ) {
@@ -8276,36 +8393,35 @@ jQuery.fn.extend( {
8276
8393
  } );
8277
8394
  }
8278
8395
 
8279
- classes = classesToArray( value );
8396
+ classNames = classesToArray( value );
8280
8397
 
8281
- if ( classes.length ) {
8282
- while ( ( elem = this[ i++ ] ) ) {
8283
- curValue = getClass( elem );
8284
- 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 ) + " " );
8285
8402
 
8286
8403
  if ( cur ) {
8287
- j = 0;
8288
- while ( ( clazz = classes[ j++ ] ) ) {
8289
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8290
- cur += clazz + " ";
8404
+ for ( i = 0; i < classNames.length; i++ ) {
8405
+ className = classNames[ i ];
8406
+ if ( cur.indexOf( " " + className + " " ) < 0 ) {
8407
+ cur += className + " ";
8291
8408
  }
8292
8409
  }
8293
8410
 
8294
8411
  // Only assign if different to avoid unneeded rendering.
8295
8412
  finalValue = stripAndCollapse( cur );
8296
8413
  if ( curValue !== finalValue ) {
8297
- elem.setAttribute( "class", finalValue );
8414
+ this.setAttribute( "class", finalValue );
8298
8415
  }
8299
8416
  }
8300
- }
8417
+ } );
8301
8418
  }
8302
8419
 
8303
8420
  return this;
8304
8421
  },
8305
8422
 
8306
8423
  removeClass: function( value ) {
8307
- var classes, elem, cur, curValue, clazz, j, finalValue,
8308
- i = 0;
8424
+ var classNames, cur, curValue, className, i, finalValue;
8309
8425
 
8310
8426
  if ( isFunction( value ) ) {
8311
8427
  return this.each( function( j ) {
@@ -8317,45 +8433,42 @@ jQuery.fn.extend( {
8317
8433
  return this.attr( "class", "" );
8318
8434
  }
8319
8435
 
8320
- classes = classesToArray( value );
8436
+ classNames = classesToArray( value );
8321
8437
 
8322
- if ( classes.length ) {
8323
- while ( ( elem = this[ i++ ] ) ) {
8324
- curValue = getClass( elem );
8438
+ if ( classNames.length ) {
8439
+ return this.each( function() {
8440
+ curValue = getClass( this );
8325
8441
 
8326
8442
  // This expression is here for better compressibility (see addClass)
8327
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8443
+ cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8328
8444
 
8329
8445
  if ( cur ) {
8330
- j = 0;
8331
- while ( ( clazz = classes[ j++ ] ) ) {
8446
+ for ( i = 0; i < classNames.length; i++ ) {
8447
+ className = classNames[ i ];
8332
8448
 
8333
8449
  // Remove *all* instances
8334
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8335
- cur = cur.replace( " " + clazz + " ", " " );
8450
+ while ( cur.indexOf( " " + className + " " ) > -1 ) {
8451
+ cur = cur.replace( " " + className + " ", " " );
8336
8452
  }
8337
8453
  }
8338
8454
 
8339
8455
  // Only assign if different to avoid unneeded rendering.
8340
8456
  finalValue = stripAndCollapse( cur );
8341
8457
  if ( curValue !== finalValue ) {
8342
- elem.setAttribute( "class", finalValue );
8458
+ this.setAttribute( "class", finalValue );
8343
8459
  }
8344
8460
  }
8345
- }
8461
+ } );
8346
8462
  }
8347
8463
 
8348
8464
  return this;
8349
8465
  },
8350
8466
 
8351
8467
  toggleClass: function( value, stateVal ) {
8352
- var type = typeof value,
8468
+ var classNames, className, i, self,
8469
+ type = typeof value,
8353
8470
  isValidValue = type === "string" || Array.isArray( value );
8354
8471
 
8355
- if ( typeof stateVal === "boolean" && isValidValue ) {
8356
- return stateVal ? this.addClass( value ) : this.removeClass( value );
8357
- }
8358
-
8359
8472
  if ( isFunction( value ) ) {
8360
8473
  return this.each( function( i ) {
8361
8474
  jQuery( this ).toggleClass(
@@ -8365,17 +8478,20 @@ jQuery.fn.extend( {
8365
8478
  } );
8366
8479
  }
8367
8480
 
8368
- return this.each( function() {
8369
- 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 );
8370
8486
 
8487
+ return this.each( function() {
8371
8488
  if ( isValidValue ) {
8372
8489
 
8373
8490
  // Toggle individual class names
8374
- i = 0;
8375
8491
  self = jQuery( this );
8376
- classNames = classesToArray( value );
8377
8492
 
8378
- while ( ( className = classNames[ i++ ] ) ) {
8493
+ for ( i = 0; i < classNames.length; i++ ) {
8494
+ className = classNames[ i ];
8379
8495
 
8380
8496
  // Check each className given, space separated list
8381
8497
  if ( self.hasClass( className ) ) {
@@ -8401,8 +8517,8 @@ jQuery.fn.extend( {
8401
8517
  if ( this.setAttribute ) {
8402
8518
  this.setAttribute( "class",
8403
8519
  className || value === false ?
8404
- "" :
8405
- dataPriv.get( this, "__className__" ) || ""
8520
+ "" :
8521
+ dataPriv.get( this, "__className__" ) || ""
8406
8522
  );
8407
8523
  }
8408
8524
  }
@@ -8417,7 +8533,7 @@ jQuery.fn.extend( {
8417
8533
  while ( ( elem = this[ i++ ] ) ) {
8418
8534
  if ( elem.nodeType === 1 &&
8419
8535
  ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
8420
- return true;
8536
+ return true;
8421
8537
  }
8422
8538
  }
8423
8539
 
@@ -8509,7 +8625,7 @@ jQuery.extend( {
8509
8625
  val :
8510
8626
 
8511
8627
  // Support: IE <=10 - 11 only
8512
- // option.text throws exceptions (#14686, #14858)
8628
+ // option.text throws exceptions (trac-14686, trac-14858)
8513
8629
  // Strip and collapse whitespace
8514
8630
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8515
8631
  stripAndCollapse( jQuery.text( elem ) );
@@ -8536,7 +8652,7 @@ jQuery.extend( {
8536
8652
  option = options[ i ];
8537
8653
 
8538
8654
  // Support: IE <=9 only
8539
- // IE8-9 doesn't update selected after form reset (#2551)
8655
+ // IE8-9 doesn't update selected after form reset (trac-2551)
8540
8656
  if ( ( option.selected || i === index ) &&
8541
8657
 
8542
8658
  // Don't return options that are disabled or in a disabled optgroup
@@ -8679,8 +8795,8 @@ jQuery.extend( jQuery.event, {
8679
8795
  return;
8680
8796
  }
8681
8797
 
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)
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)
8684
8800
  if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8685
8801
 
8686
8802
  bubbleType = special.delegateType || type;
@@ -8707,9 +8823,7 @@ jQuery.extend( jQuery.event, {
8707
8823
  special.bindType || type;
8708
8824
 
8709
8825
  // jQuery handler
8710
- handle = (
8711
- dataPriv.get( cur, "events" ) || Object.create( null )
8712
- )[ event.type ] &&
8826
+ handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
8713
8827
  dataPriv.get( cur, "handle" );
8714
8828
  if ( handle ) {
8715
8829
  handle.apply( cur, data );
@@ -8734,7 +8848,7 @@ jQuery.extend( jQuery.event, {
8734
8848
  acceptData( elem ) ) {
8735
8849
 
8736
8850
  // 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)
8851
+ // Don't do default actions on window, that's where global variables be (trac-6170)
8738
8852
  if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8739
8853
 
8740
8854
  // Don't re-trigger an onFOO event when we call its FOO() method
@@ -8856,7 +8970,7 @@ var rquery = ( /\?/ );
8856
8970
 
8857
8971
  // Cross-browser xml parsing
8858
8972
  jQuery.parseXML = function( data ) {
8859
- var xml;
8973
+ var xml, parserErrorElem;
8860
8974
  if ( !data || typeof data !== "string" ) {
8861
8975
  return null;
8862
8976
  }
@@ -8865,12 +8979,17 @@ jQuery.parseXML = function( data ) {
8865
8979
  // IE throws on parseFromString with invalid input.
8866
8980
  try {
8867
8981
  xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8868
- } catch ( e ) {
8869
- xml = undefined;
8870
- }
8982
+ } catch ( e ) {}
8871
8983
 
8872
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8873
- jQuery.error( "Invalid XML: " + data );
8984
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
8985
+ if ( !xml || parserErrorElem ) {
8986
+ jQuery.error( "Invalid XML: " + (
8987
+ parserErrorElem ?
8988
+ jQuery.map( parserErrorElem.childNodes, function( el ) {
8989
+ return el.textContent;
8990
+ } ).join( "\n" ) :
8991
+ data
8992
+ ) );
8874
8993
  }
8875
8994
  return xml;
8876
8995
  };
@@ -8971,16 +9090,14 @@ jQuery.fn.extend( {
8971
9090
  // Can add propHook for "elements" to filter or add form elements
8972
9091
  var elements = jQuery.prop( this, "elements" );
8973
9092
  return elements ? jQuery.makeArray( elements ) : this;
8974
- } )
8975
- .filter( function() {
9093
+ } ).filter( function() {
8976
9094
  var type = this.type;
8977
9095
 
8978
9096
  // Use .is( ":disabled" ) so that fieldset[disabled] works
8979
9097
  return this.name && !jQuery( this ).is( ":disabled" ) &&
8980
9098
  rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8981
9099
  ( this.checked || !rcheckableType.test( type ) );
8982
- } )
8983
- .map( function( _i, elem ) {
9100
+ } ).map( function( _i, elem ) {
8984
9101
  var val = jQuery( this ).val();
8985
9102
 
8986
9103
  if ( val == null ) {
@@ -9005,7 +9122,7 @@ var
9005
9122
  rantiCache = /([?&])_=[^&]*/,
9006
9123
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
9007
9124
 
9008
- // #7653, #8125, #8152: local protocol detection
9125
+ // trac-7653, trac-8125, trac-8152: local protocol detection
9009
9126
  rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
9010
9127
  rnoContent = /^(?:GET|HEAD)$/,
9011
9128
  rprotocol = /^\/\//,
@@ -9028,12 +9145,13 @@ var
9028
9145
  */
9029
9146
  transports = {},
9030
9147
 
9031
- // 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
9032
9149
  allTypes = "*/".concat( "*" ),
9033
9150
 
9034
9151
  // Anchor tag for parsing the document origin
9035
9152
  originAnchor = document.createElement( "a" );
9036
- originAnchor.href = location.href;
9153
+
9154
+ originAnchor.href = location.href;
9037
9155
 
9038
9156
  // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
9039
9157
  function addToPrefiltersOrTransports( structure ) {
@@ -9098,7 +9216,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
9098
9216
 
9099
9217
  // A special extend for ajax options
9100
9218
  // that takes "flat" options (not to be deep extended)
9101
- // Fixes #9887
9219
+ // Fixes trac-9887
9102
9220
  function ajaxExtend( target, src ) {
9103
9221
  var key, deep,
9104
9222
  flatOptions = jQuery.ajaxSettings.flatOptions || {};
@@ -9414,8 +9532,8 @@ jQuery.extend( {
9414
9532
  // Context for global events is callbackContext if it is a DOM node or jQuery collection
9415
9533
  globalEventContext = s.context &&
9416
9534
  ( callbackContext.nodeType || callbackContext.jquery ) ?
9417
- jQuery( callbackContext ) :
9418
- jQuery.event,
9535
+ jQuery( callbackContext ) :
9536
+ jQuery.event,
9419
9537
 
9420
9538
  // Deferreds
9421
9539
  deferred = jQuery.Deferred(),
@@ -9509,12 +9627,12 @@ jQuery.extend( {
9509
9627
  deferred.promise( jqXHR );
9510
9628
 
9511
9629
  // Add protocol if not provided (prefilters might expect it)
9512
- // 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)
9513
9631
  // We also use the url parameter if available
9514
9632
  s.url = ( ( url || s.url || location.href ) + "" )
9515
9633
  .replace( rprotocol, location.protocol + "//" );
9516
9634
 
9517
- // Alias method option to type as per ticket #12004
9635
+ // Alias method option to type as per ticket trac-12004
9518
9636
  s.type = options.method || options.type || s.method || s.type;
9519
9637
 
9520
9638
  // Extract dataTypes list
@@ -9557,7 +9675,7 @@ jQuery.extend( {
9557
9675
  }
9558
9676
 
9559
9677
  // 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)
9678
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
9561
9679
  fireGlobals = jQuery.event && s.global;
9562
9680
 
9563
9681
  // Watch for a new set of requests
@@ -9586,7 +9704,7 @@ jQuery.extend( {
9586
9704
  if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9587
9705
  cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9588
9706
 
9589
- // #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
9590
9708
  delete s.data;
9591
9709
  }
9592
9710
 
@@ -9727,8 +9845,10 @@ jQuery.extend( {
9727
9845
  response = ajaxHandleResponses( s, jqXHR, responses );
9728
9846
  }
9729
9847
 
9730
- // Use a noop converter for missing script
9731
- if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
9848
+ // Use a noop converter for missing script but not if jsonp
9849
+ if ( !isSuccess &&
9850
+ jQuery.inArray( "script", s.dataTypes ) > -1 &&
9851
+ jQuery.inArray( "json", s.dataTypes ) < 0 ) {
9732
9852
  s.converters[ "text script" ] = function() {};
9733
9853
  }
9734
9854
 
@@ -9857,7 +9977,7 @@ jQuery._evalUrl = function( url, options, doc ) {
9857
9977
  return jQuery.ajax( {
9858
9978
  url: url,
9859
9979
 
9860
- // Make this explicit, since user can override this through ajaxSetup (#11264)
9980
+ // Make this explicit, since user can override this through ajaxSetup (trac-11264)
9861
9981
  type: "GET",
9862
9982
  dataType: "script",
9863
9983
  cache: true,
@@ -9966,7 +10086,7 @@ var xhrSuccessStatus = {
9966
10086
  0: 200,
9967
10087
 
9968
10088
  // Support: IE <=9 only
9969
- // #1450: sometimes IE returns 1223 when it should be 204
10089
+ // trac-1450: sometimes IE returns 1223 when it should be 204
9970
10090
  1223: 204
9971
10091
  },
9972
10092
  xhrSupported = jQuery.ajaxSettings.xhr();
@@ -10038,7 +10158,7 @@ jQuery.ajaxTransport( function( options ) {
10038
10158
  } else {
10039
10159
  complete(
10040
10160
 
10041
- // File: protocol always yields status 0; see #8605, #14207
10161
+ // File: protocol always yields status 0; see trac-8605, trac-14207
10042
10162
  xhr.status,
10043
10163
  xhr.statusText
10044
10164
  );
@@ -10099,7 +10219,7 @@ jQuery.ajaxTransport( function( options ) {
10099
10219
  xhr.send( options.hasContent && options.data || null );
10100
10220
  } catch ( e ) {
10101
10221
 
10102
- // #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
10103
10223
  if ( callback ) {
10104
10224
  throw e;
10105
10225
  }
@@ -10466,12 +10586,6 @@ jQuery.offset = {
10466
10586
  options.using.call( elem, props );
10467
10587
 
10468
10588
  } else {
10469
- if ( typeof props.top === "number" ) {
10470
- props.top += "px";
10471
- }
10472
- if ( typeof props.left === "number" ) {
10473
- props.left += "px";
10474
- }
10475
10589
  curElem.css( props );
10476
10590
  }
10477
10591
  }
@@ -10640,8 +10754,11 @@ jQuery.each( [ "top", "left" ], function( _i, prop ) {
10640
10754
 
10641
10755
  // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10642
10756
  jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10643
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10644
- function( defaultExtra, funcName ) {
10757
+ jQuery.each( {
10758
+ padding: "inner" + name,
10759
+ content: type,
10760
+ "": "outer" + name
10761
+ }, function( defaultExtra, funcName ) {
10645
10762
 
10646
10763
  // Margin is only for outerHeight, outerWidth
10647
10764
  jQuery.fn[ funcName ] = function( margin, value ) {
@@ -10726,7 +10843,8 @@ jQuery.fn.extend( {
10726
10843
  }
10727
10844
  } );
10728
10845
 
10729
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10846
+ jQuery.each(
10847
+ ( "blur focus focusin focusout resize scroll click dblclick " +
10730
10848
  "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10731
10849
  "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10732
10850
  function( _i, name ) {
@@ -10737,14 +10855,17 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10737
10855
  this.on( name, null, data, fn ) :
10738
10856
  this.trigger( name );
10739
10857
  };
10740
- } );
10858
+ }
10859
+ );
10741
10860
 
10742
10861
 
10743
10862
 
10744
10863
 
10745
10864
  // Support: Android <=4.0 only
10746
10865
  // Make sure we trim BOM and NBSP
10747
- 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;
10748
10869
 
10749
10870
  // Bind a function to a context, optionally partially applying any
10750
10871
  // arguments.
@@ -10811,7 +10932,7 @@ jQuery.isNumeric = function( obj ) {
10811
10932
  jQuery.trim = function( text ) {
10812
10933
  return text == null ?
10813
10934
  "" :
10814
- ( text + "" ).replace( rtrim, "" );
10935
+ ( text + "" ).replace( rtrim, "$1" );
10815
10936
  };
10816
10937
 
10817
10938
 
@@ -10859,8 +10980,8 @@ jQuery.noConflict = function( deep ) {
10859
10980
  };
10860
10981
 
10861
10982
  // 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)
10983
+ // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
10984
+ // and CommonJS for browser emulators (trac-13566)
10864
10985
  if ( typeof noGlobal === "undefined" ) {
10865
10986
  window.jQuery = window.$ = jQuery;
10866
10987
  }