aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 3.6.03.6.0Timmy Willison2021-03-021-1/+1
|
* Support: ensure display is set to block for the support div (#4844)Timmy Willison2021-02-161-0/+8
| | | | | | - Fixes an issue with the support test in iframes in Android 8 Chrome 86+, where display: inline resulted in unexpected height values. Fixes gh-4832
* Deferred: Rename master to primaryMichał Gołębiowski-Owczarek2021-01-121-8/+8
| | | | | | Closes gh-4828 (cherry picked from a32cf6324f8f2190e66a687e94be9687ebf840b7)
* Dimensions: Modify reliableTrDimensions support test to account for FFTimmy Willison2021-01-111-2/+13
| | | | | | | | | Firefox incorrectly (or perhaps correctly) includes table borders in computed dimensions, but they are the only one. Workaround this by testing for it and falling back to offset properties Fixes gh-4529 Closes gh-4807
* Core: Report browser errors in parseXMLMichał Gołębiowski-Owczarek2020-12-081-6/+11
| | | | | | | Fixes gh-4784 Closes gh-4816 (cherry picked from commit 8969732518470a7f8e654d5bc5be0b0076cb0b87)
* Event: Make focus re-triggering not focus the original element backMichał Gołębiowski-Owczarek2020-12-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If during a focus handler another focus event is triggered: ```js elem1.on( "focus", function() { elem2.trigger( "focus" ); } ); ``` due to their synchronous nature everywhere outside of IE the hack added in gh-4279 to leverage native events causes the native `.focus()` method to be called last for the initial element, making it steal the focus back. Since the native method is already being called in `leverageNative`, we can skip that final call. This aligns with changes to the `_default` method for the `click` event that were added when `leverageNative` was introduced there. A side effect of this change is that now `focusin` will only propagate to the document for the last focused element. This is a change in behavior but it also aligns us better with how this works with native methods. Fixes gh-4382 Closes gh-4813 Ref gh-4279 (cherry picked from commit dbcffb396c2db61ff96edc4162602e850797d61f)
* Event: Don't crash if an element is removed on blurMichał Gołębiowski-Owczarek2020-10-191-1/+7
| | | | | | | | | | | | | In Chrome, if an element having a `focusout` handler is blurred by clicking outside of it, it invokes the handler synchronously. If that handler calls `.remove()` on the element, the data is cleared, leaving private data undefined. We're reading a property from that data so we need to guard against this. Fixes gh-4417 Closes gh-4799 (cherry picked from commit 5c2d08704e289dd2745bcb0557b35a9c0e6af4a4)
* Event: Remove the event.which shimMichał Gołębiowski-Owczarek2020-08-261-32/+2
| | | | | | | | | | | All supported browsers implement this property by themselves. The shim was only needed for IE <9. Fixes gh-3235 Closes gh-4765 Ref gh-4755 (cherry picked from commit 1a5fff4c169dbaa2df72c656868bcf60ed4413d0)
* Ajax: Execute JSONP error script responsesDallas Fraser2020-08-251-2/+4
| | | | | | | | | | | | | | | Issue gh-4379 was meant to be a bug fix but the JSONP case is a bit special: under the hood it's a script but it simulates JSON responses in an environment without a CORS setup and sending JSON payloads on error responses is quite typical there. This commit makes JSONP error responses still execute the payload. The regular script error responses continue to be skipped. Fixes gh-4771 Closes gh-4773 (cherry picked from commit a1e619b03a557b47c3e26a5e74af12b63a0d5e73)
* Core: Bring back QtWebKit support for jQuery 3.xNatalia Sroka2020-07-271-1/+5
| | | | | | | Allow jQuery to recognize that DOM types such as HTMLCollection or NodeList are not functions. Fixes gh-4756 Closes gh-4757
* Revert "Offset: Send px-ed strings to .css()"Michał Gołębiowski-Owczarek2020-07-201-6/+0
| | | | | | | | | | | | The way warning against number values in `.css()` setters was done in jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348 there's no need to send px-ed strings for `top` & `left` as they already don't get the "px" suffix. This reverts commit 57038faebc6ece5bd666c28303f8a91ff59153eb. Closes gh-4753 Ref jquery/jquery-migrate/pull/337 Ref jquery/jquery-migrate/pull/348
* Build: Update eslint-config-jquery, fix linting violationsMichał Gołębiowski-Owczarek2020-05-181-1/+1
| | | | | | | | Closes gh-4696 Ref jquery/eslint-config-jquery#15 Ref jquery/eslint-config-jquery#16 (cherry picked from commit ef4d6ca6c3a1b276fedc27b1f3a18823276f01a3)
* Docs: Change JS Foundation mentions to OpenJS FoundationMichał Gołębiowski-Owczarek2020-05-181-1/+1
| | | | | | Closes gh-4711 (cherry picked from 11611967adf2bd9ff4304132f917629ec1134049)
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-0516-44/+70
| | | | | | | | | | | 1. Correct code indentations based on jQuery Style Guide (contribute.jquery.org/style-guide/js/#spacing). 2. Add rules to "src/.eslintrc.json" to enable "enforcing consistent indentation", with minimal changes to the current code. Closes gh-4672 (cherry picked from 3d62d5704989f17d3a20ae7521d52e9c8c60b4ee)
* Data: Make the data object a regular object againMichał Gołębiowski-Owczarek2020-04-201-1/+1
| | | | | | | | | | | | | The change in gh-4603 made the object returned by `elem.data()` a prototype-less object. That's a desired change to support keys colliding with `Object.prototype` properties but it's also a breaking change so it has to wait for jQuery 4.0.0. A 3.x-only test was added to avoid breaking it in the future on this branch. Fixes gh-4665 Ref gh-4603 Closes gh-4666
* Ajax: Do not execute scripts for unsuccessful HTTP responsesSean Robinson2020-04-061-0/+5
| | | | | | | | | | | | The script transport used to evaluate fetched script sources which is undesirable for unsuccessful HTTP responses. This is different to other data types where such a convention was fine (e.g. in case of JSON). (cherry picked from 50871a5a85cc802421b40cc67e2830601968affe) Fixes gh-4250 Fixes gh-4655 Closes gh-4379
* Ajax: Overwrite s.contentType with content-type header value, if anyChristian Wenz2020-04-061-0/+9
| | | | | | | | | | | | | | This fixes the issue of "%20" in POST data being replaced with "+" even for requests with content-type different from "application/x-www-form-urlencoded", e.g. for "application/json". Fixes gh-4119 Closes gh-4650 (cherry picked from 7fb90a6beaeffe16699800f73746748f6a5cc2de) Co-authored-by: Richard Gibson <richard.gibson@gmail.com> Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
* Event: Use only one focusin/out handler per matching window & documentMichał Gołębiowski-Owczarek2020-04-061-2/+5
| | | | | | | | | | | | | | | The `doc` variable in: https://github.com/jquery/jquery/blob/3.4.1/src/event/focusin.js#L30 matched `document` for `document` & `window` for `window`, creating two separate wrapper event handlers & calling handlers twice if at least one `focusout` or `focusin` handler was attached on *both* `window` & `document`, or on `window` & another regular node. Also, fix the "focusin from an iframe" test to actually verify the behavior from commit 1cecf64e5aa415367a7dae0b55c2dd17b591442d - the commit that introduced the regression - to make sure we don't regress on either front. Fixes gh-4652 Closes gh-4656
* Manipulation: Skip the select wrapper for <option> outside of IE 9Michał Gołębiowski-Owczarek2020-03-302-7/+14
| | | Closes gh-4647
* Manipulation: Make jQuery.htmlPrefilter an identity functionMichał Gołębiowski-Owczarek2020-03-161-8/+1
| | | | | | Closes gh-4642 (cherry picked from 90fed4b453a5becdb7f173d9e3c1492390a1441f)
* Data:Event:Manipulation: Prevent collisions with Object.prototypeMichał Gołębiowski-Owczarek2020-03-024-9/+11
| | | | | | | | | | Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. Fixes gh-3256 Closes gh-4603 (cherry picked from commit 9d76c0b163675505d1a901e5fe5249a2c55609bc)
* Build: Enable ESLint one-var rule for var declarations in browser codeMichał Gołębiowski-Owczarek2020-03-022-5/+6
| | | | | | | | | | Node.js code is written more & more commonly in ES6+ so it doesn't make sense to enable it there. There are many violations in test code so it's disabled there as well. Closes gh-4615 (cherry picked from commit 4a7fc8544e2020c75047456d11979e4e3a517fdf)
* Core:Ajax: Align nonce & global with master, fix an AMD issueMichał Gołębiowski-Owczarek2020-02-244-5/+6
| | | | | | | | | | | | | | | | This commit aligns the `3.x-stable` branch with `master` in two aspects: 1. It migrates the nonce module to return an object instead of a primitive variable. This had to be changed on `master` as in ES modules you export live read-only bindings to variables, meaning you can't increment the nonce directly. Also, the way it was done so far was working differently in AMD & the single built file - in the built file one nonce variable was declared, accessed and incremented. In AMD mode separate instances were create for each module that depend on the nonce module, creating unintended nonce clashes. 2. Whether the `noGlobal` parameter was set to `true` is now checked using the typeof operator to align with `master`. Closes gh-4612 Ref gh-4541 Ref d0ce00cdfa680f1f0c38460bc51ea14079ae8b07
* Core: Fire iframe script in its context, add doc param in globalEvalMichał Gołębiowski-Owczarek2020-02-103-6/+7
| | | | | | | | | | | | | 1. Support passing custom document to jQuery.globalEval; the script will be invoked in the context of this document. 2. Fire external scripts appended to iframe contents in that iframe context; this was already supported & tested for inline scripts but not for external ones. Fixes gh-4518 Closes gh-4601 (cherry picked from commit 4592595b478be979141ce35c693dbc6b65647173)
* Build:Tests: Fix custom build tests, verify on Travis; name Travis jobsMichał Gołębiowski-Owczarek2020-01-273-1/+3
| | | | | | | | | | | | | | | | This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see at a glance that a particular job is running on Firefox ESR, for example. Ref gh-4577 Ref gh-4596 Closes gh-4600
* Ajax: Deprecate AJAX event aliases, inline event/alias into deprecatedMichał Gołębiowski-Owczarek2020-01-215-53/+51
| | | | | | | | | | | A new `src/deprecated` directory makes it possible to exclude some deprecated APIs from a custom build when their respective "parent" module is excluded without keeping that module outside of the `src/deprecated` directory or the `src/deprecated.js` file. Closes gh-4572 (cherry picked from 23d53928f383b0e7440bf4b08b7524e6af232fad)
* Event: Only attach events to objects that accept data - for realMichał Gołębiowski-Owczarek2019-12-091-3/+4
| | | | | | | | | | | | | There was a check in jQuery.event.add that was supposed to make it a noop for objects that don't accept data like text or comment nodes. The problem was the check was incorrect: it assumed `dataPriv.get( elem )` returns a falsy value for an `elem` that doesn't accept data but that's not the case - we get an empty object then. The check was changed to use `acceptData` directly. (cherry picked from d5c505e35d8c74ce8e9d99731a1a7eab0e0d911c) Fixes gh-4397 Closes gh-4558
* Offset: Send px-ed strings to .css()Dave Methvin2019-10-211-0/+6
| | | | | An upcoming release of Migrate will generate warnings for calls to .css() that pass numbers rather than strings, see jquery/jquery-migrate#296 . At the moment, core's .offset() setter passes numbers rather than px strings so it would throw warnings. This commit fixes that. Closes gh-4508
* CSS: Workaround buggy getComputedStyle on table rows in IE/EdgeMichał Gołębiowski-Owczarek2019-10-142-10/+49
| | | | Fixes gh-4490 Closes gh-4503
* Build: ESLint: forbid unused function parametersMichał Gołębiowski-Owczarek2019-09-2614-23/+21
| | | | | | | | | | | | | | | | This commit requires all function parameters to be used, not just the last one. In cases where that's not possible as we need to match an external API, there's an escape hatch of prefixing an unused argument with `_`. This change makes it easier to catch unused AMD dependencies and unused parameters in internal functions the API of which we may change at will, among other things. Unused AMD dependencies have been removed as part of this commit. Closes gh-4381 (cherry-picked from 438b1a3e8a52d3e4efd8aba45498477038849c97)
* Effect: Fix a unnecessary conditional statement in .stop()Wonseop Kim2019-09-261-1/+1
| | | | | | | | | | | | Because of the above conditional, the 'type' variable has a value of type 'string' or undefined. Therefore, boolean comparisons for 'type' variable is always unnecessary because it return true. The patch removed the unnecessary conditional statement. Fixes gh-4374 Closes gh-4375 (cherry picked from commit 110802c7f22b677ef658963aa95ebdf5cb9c5573)
* Core: Deprecate jQuery.trimShashanka Nataraj2019-09-262-12/+10
| | | | | | | Fixes gh-4363 Closes gh-4461 (cherry picked from 5ea5946094784f68437ef26d463dfcfbbbaff1f6)
* Core: Use Array.prototype.flat where supportedAhmed.S.ElAfifi2019-09-254-14/+22
| | | | | | | | | | | | | Calling `Array.prototype.concat.apply( [], inputArray )` to flatten `inputArray` crashes for large arrays; using `Array.prototype.flat` avoids these issues in browsers that support it. In case it's necessary to support these large arrays even in older browsers, a polyfill for `Array.prototype.flat` can be loaded. This is already being done by many applications. (cherry picked from 9df4f1de12728b44a4b0f91748f12421008d9079) Fixes gh-4320 Closes gh-4459
* Core: Implement .even() & .odd() to replace POS :even & :oddMichał Gołębiowski-Owczarek2019-09-241-0/+12
| | | | | | | | | `:even` & `:odd` are deprecated since jQuery 3.4.0 & will be removed in 4.0.0. The new `even()` & `odd()` methods will make the migration easier. Closes gh-4485 (cherry picked from commit 78420d427cf3734d9264405fcbe08b76be182a95)
* Selector: Make selector-native's isXMLDoc recognize HTML-embedded SVGMichał Gołębiowski-Owczarek2019-07-291-5/+9
| | | | | | | | | | This commit also backports some jQuery.isXMLDoc tests from master so that this behavior doesn't regress. (partially cherry-picked from 79b74e043a4ee737d44a95094ff1184e40bd5b16) Closes gh-4438 Ref jquery/sizzle#378 Ref jquery/sizzle#436
* Traversing: Fix `contents()` on `<object>`s with children in IEMichał Gołębiowski-Owczarek2019-05-081-2/+9
| | | | | | | | | | | | The original fix didn't account for the fact that in IE `<object>` elements with no `data` attribute have an object `contentDocument`. The fix leverages the fact that this special object has a null prototype. (cherry-picked from ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3) Closes gh-4390 Ref gh-4384 Ref gh-4385
* Traversing: Fix `contents()` on `<object>`s with childrenPat O'Callaghan2019-05-061-1/+1
| | | | | | | (cherry-picked from 4d865d96aa5aae91823c50020b5c19da79566811) Fixes gh-4384 Closes gh-4385
* Core: Make isAttached work with iOS 10.0-10.2Michał Gołębiowski-Owczarek2019-04-291-1/+5
| | | | | | | | | | | The test for Shadow DOM v1 support has been changed to rely on the presence of `documentElement.getRootNode` as iOS 10.0-10.2 supports `attachShadow` but doesn't support `getRootNode`. No new test is necessary - iOS 10.0 fails lots of our test suite because of this bug. Fixes gh-4356 Closes gh-4360
* Event: Prevent leverageNative from registering duplicate dummy handlersRichard Gibson2019-04-291-5/+5
| | | Closes gh-4353
* Event: Fix handling of multiple async focus eventsRichard Gibson2019-04-291-12/+18
| | | | Fixes gh-4350 Closes gh-4354
* Build: Fix unresolved jQuery reference in finalPropNameMichał Gołębiowski-Owczarek2019-04-172-4/+12
| | | | | | | | | | Also, prevent further similar breakages by changing our ESLint configuration to disallow relying on a global jQuery object in AMD modules. (cherry-picked from 874030583c9b94603de467124420e6c7a1c3c8ac) Fixes gh-4358 Closes gh-4361
* Core: Preserve CSP nonce on scripts with src attribute in DOM manipulationbuddh42019-03-252-3/+5
| | | | | Fixes gh-4323 Closes gh-4328
* Event: Prevent leverageNative from double-firing focusinRichard Gibson2019-03-251-88/+84
| | | | | | Also, reduce size. Closes gh-4329 Ref gh-4279
* Core: Prevent Object.prototype pollution for $.extend( true, ... )Michał Gołębiowski-Owczarek2019-03-251-1/+2
| | | Closes gh-4333
* Event: Leverage native events for focus/blur/click; propagate additional dataRichard Gibson2019-03-204-24/+161
| | | | | | | | | | | | | | | | | | | | | Summary of the changes/fixes: 1. Trigger checkbox and radio click events identically (cherry-picked from b442abacbb8464f0165059e8da734e3143d0721f that was reverted before). 2. Manually trigger a native event before checkbox/radio handlers. 3. Add test coverage for triggering namespaced native-backed events. 4. Propagate extra parameters passed when triggering the click event to the handlers. 5. Intercept and preserve namespaced native-backed events. 6. Leverage native events for focus and blur. 7. Accept that focusin handlers may fire more than once for now. Fixes gh-1741 Fixes gh-3423 Fixes gh-3751 Fixes gh-4139 Closes gh-4279 Ref gh-1367 Ref gh-3494
* CSS: Avoid forcing a reflow in width/height getters unless necessaryMichał Gołębiowski-Owczarek2019-03-181-3/+12
| | | | | | | | Fixes gh-4322 Closes gh-4325 Ref gh-3991 Ref gh-4010 Ref gh-4185 Ref gh-4187
* Build: Remove obsolete globals from ESLint configurationMichał Gołębiowski-Owczarek2019-02-191-1/+5
| | | | | We had quite a few obsolete globals declared in various ESLint config files. We also no longer allow to rely on the `noGlobal` & `jQuery` globals in the built file which is not needed. Closes gh-4301
* Core: Support passing nonce through jQuery.globalEvalMichał Gołębiowski-Owczarek2019-01-213-15/+18
| | | | | | Fixes gh-4278 Closes gh-4280 Ref gh-3541 Ref gh-4269
* Manipulation: Respect script nomodule attribute in DOM manipulationMichał Gołębiowski-Owczarek2019-01-211-1/+1
| | | | | | | | | | | | | PR #3869 added support for `<script type="module">` & some support for the `nomodule` attribute but with no tests for `nomodule` and with the attribute only respected on inline scripts. This commit adds support for source-based scripts as well. It also adds tests for `nomodule`, including making sure legacy browsers execute such scripts as they'd natively do - that's the whole point of `nomodule` scripts, after all. Fixes gh-4281 Closes gh-4282 Ref gh-3871 Ref gh-3869
* Core: Preserve CSP nonce on scripts in DOM manipulationMichał Gołębiowski-Owczarek2019-01-141-0/+10
| | | | Fixes gh-3541 Closes gh-4269