aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Build: fix inconsistent builds in Node 20Timmy Willison2023-09-202-19/+15
| | | | | | | - one fileOverrides per build - only run the lint build when running lint Close gh-5332
* Docs: update watch task in CONTRIBUTING.mdTimmy Willison2023-09-201-2/+2
| | | Close gh-5331
* Build: add commit SHAs and last runs to comparisonsTimmy Willison2023-09-201-20/+66
| | | | | | | - only remove the short SHA and .dirty from version strings - automatically reset the cache on version mismatch Close gh-5329
* Build: add new factory files to dist eslintTimmy Willison2023-09-201-1/+5
|
* CSS:Selector: Align with 3.x, remove the outer `selector.js` wrapperMichał Gołębiowski-Owczarek2023-09-208-23/+39
| | | | | | | | | | | | | | | | Bring some changes from `3.x-stable`: * rename `rtrim` to `rtrimCSS` to distinguish from the previous `rtrim` regex used for `jQuery.trim` * backport one `id` selector test that avoids the selector engine path Other changes: * remove the inner function wrapper from `selector.js` by renaming the imported `document.js` value * use `jQuery.error` in `selectorError` * make Selector tests pass in all-modules runs by fixing a sinon mistake in Core tests - Core tests had a spy set up for `jQuery.error` that wasn't cleaned up, influencing Selector tests when all were run together Closes gh-5295
* Core: Add more info about named exportsMichał Gołębiowski-Owczarek2023-09-201-5/+23
| | | | | | Also, fix an example importing from `jquery/src/css.js` as that is supposed to use named exports now. Closes gh-5328
* Core: Simplify code post browser support reductionMichał Gołębiowski-Owczarek2023-09-2011-160/+101
| | | | | | | | | | | | | | | | | Summary of the changes: * Core: Simplify code post browser support reduction * Tests: Remove legacy jQuery.cache & oldIE leftovers * Tests: Reformat JavaScript in delegatetest.html * Docs: "jQuery Foundation Projects" -> "jQuery Projects" * Tests: Drop an unused localfile.html file (modern browsers don't support the `file:` protocol this way, there's no point in keeping the file around) * Effects: Remove a redundant `!fn` check (`fn || !fn && easing` is equivalent to `fn || easing`; simplify the code) * CSS: Explain the fallback to direct object access in curCSS better * Tests: Deduplicate `jQuery.parseHTML` test titles * Dimensions: Add a test for fractional values * Tests: Fix a buggy WebKit regex Closes gh-5296
* Core: Move the factory to separate exportsMichał Gołębiowski-Owczarek2023-09-1927-148/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since versions 1.11.0/2.1.0, jQuery has used a module wrapper with one strange addition - in CommonJS environments, if a global `window` with a `document` was not present, jQuery exported a factory accepting a `window` implementation and returning jQuery. This approach created a number of problems: 1. Properly typing jQuery would be a nightmare as the exported value depends on the environment. In practice, typing definitions ignored the factory case. 2. Since we now use named exports for the jQuery module version, it felt weird to have `jQuery` and `$` pointing to the factory instead of real jQuery. Instead, for jQuery 4.0 we leverage the just added `exports` field in `package.json` to expose completely separate factory entry points: one for the full build, one for the slim one. Exports definitions for `./factory` & `./factory-slim` are simpler than for `.` and `./slim` - this is because it's a new entry point, we only expose a named export and so there's no issue with just pointing Node.js to the CommonJS version (we cannot use the module version for `import` from Node.js to avoid double package hazard). The factory entry points are also not meant for the Web browser which always has a proper `window` - and they'd be unfit for an inclusion in a regular script tag anyway. Because of that, we also don't generate minified versions of these entry points. The factory files are not pushed to the CDN since they are mostly aimed at Node.js. Closes gh-5293
* Build: Bump qs, socket.io-parser, socket.io & json5dependabot[bot]2023-09-181-78/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1: Bump json5 from 2.2.0 to 2.2.3 Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... 2: Bump socket.io-parser and socket.io Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together. Updates `socket.io-parser` from 4.0.5 to 4.2.4 - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.5...4.2.4) Updates `socket.io` from 4.5.1 to 4.7.2 - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/4.5.1...4.7.2) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect - dependency-name: socket.io dependency-type: indirect ... 3: Bump qs from 6.5.2 to 6.5.3 Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Closes gh-5324 Closes gh-5325 Closes gh-5326 Signed-off-by: dependabot[bot] <support@github.com>
* Build: migrate most grunt tasks off of gruntTimmy Willison2023-09-1862-1655/+9973
| | | | | | | | | | | | | | | | | | | | | | | | | Updated tasks include: - lint - npmcopy - build, minify, and process for distribution. - new custom build command using yargs - compare size of minified/gzip built files - pretest scripts, including qunit-fixture, babel transpilation, and npmcopy - node smoke tests - promises aplus tests - new watch task using `rollup.watch` directly Also: - upgraded husky and added the new lint command - updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new - Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See https://github.com/import-js/eslint-plugin-import/issues/2556 - committed package-lock.json - updated all test scripts to use the new build - added an express test server that uses middleware-mockserver (this can be used to run tests without karma) - build-all-variants is now build:all Close gh-5318
* Core: Use named exports in `src/`Michał Gołębiowski-Owczarek2023-09-12136-478/+424
| | | | | | | | | The `default` export is treated differently across tooling when transpiled to CommonJS - tools differ on whether `module.exports` represents the full module object or just its default export. Switch `src/` modules to named exports for tooling consistency. Fixes gh-5262 Closes gh-5292
* Build: Bump actions/checkout, actions/setup-node & github/codeql-actiondependabot[bot]2023-09-062-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1: Bump actions/checkout from 3.5.3 to 3.6.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/c85c95e3d7251135ab7dc9ce3241c5835cc595a9...f43a0e5ff2bd294095638e18286ca9a3d1956744) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... 2: Bump actions/setup-node from 3.6.0 to 3.8.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.6.0 to 3.8.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c...5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... 3: Bump github/codeql-action from 2.20.1 to 2.21.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.20.1 to 2.21.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f6e388ebf0efc915c6c5b165b019ee61a6746a38...00e563ead9f72a8461b24876bee2d0c2e8bd2ee8) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor ... Closes gh-5311 Closes gh-5312 Closes gh-5313 Signed-off-by: dependabot[bot] <support@github.com>
* Build: Update mailmap entry for KrinkleTimo Tijhof2023-08-251-1/+1
| | | Close gh-5309
* Build: replace CRLF with LF during minifyTimmy Willison2023-08-101-1/+2
| | | | | | - SWC is not respecting the git setting and does not have an option to force LF. This fixes the build on Windows. Close gh-5305
* Build: Add `exports` to package.json, export slim & esm buildsMichał Gołębiowski-Owczarek2023-07-1052-308/+887
| | | | | | | | | | | | | | | | | | | | Summary of the changes: * define the `exports` field in `package.json`; `jQuery` & `$` are also exported as named exports in ESM builds now * declare `"type": "module"` globally except for the `build` folder * add the `--esm` option to `grunt custom`, generating jQuery as an ECMAScript module into the `dist-module` folder * expand `node_smoke_tests` to test the slim & ESM builds and their various combinations; also, test both jQuery loaded via a path to the file as well as from module specifiers that should be parsed via the `exports` feature * add details about ESM usage to the release package README * run `compare_size` on all built minified files; don't run it anymore on unminified files where they don't provide lots of value * remove the remove_map_comment task; SWC doesn't insert the `//# sourceMappingURL=` pragma by default so there's nothing to strip Fixes gh-4592 Closes gh-5255
* CSS: Make the reliableTrDimensions support test work with Bootstrap CSSMichał Gołębiowski-Owczarek2023-07-105-2/+39
| | | | | | | | | | | | | | | | | | | Bootstrap 5 includes the following CSS on the page: ```css *, *::before, *::after { box-sizing: border-box; } ``` That threw our `reliableTrDimensions` support test off. This change fixes the support test and adds a unit test ensuring support test values on a page including Bootstrap 5 CSS are the same as on a page without it. Fixes gh-5270 Closes gh-5278 Ref gh-5279
* Build: Switch form Terser to SWC for JS minification (#5286)Michał Gołębiowski-Owczarek2023-07-105-19/+88
| | | | | | | | Also, as part of this, fix the `file` & `sources` properties of the source map file. Fixes gh-5285 Closes gh-5286 Ref gh-5258
* Build: Make sure `*.cjs` & `*.mjs` files use UNIX line endings as wellMichał Gołębiowski-Owczarek2023-07-101-0/+3
| | | | | | We've had this rule for `*.js` files so far but we now have two new JS extensions. Closes gh-5290
* Build: switch preferred email for timmywilTimmy Willison2023-07-101-4/+4
| | | Close gh-5288
* Build: Bump github/codeql-action & actions/checkoutdependabot[bot]2023-07-022-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1: Bump github/codeql-action from 2.3.6 to 2.20.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.6 to 2.20.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/83f0fe6c4988d98a455712a27f0255212bba9bd4...f6e388ebf0efc915c6c5b165b019ee61a6746a38) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor ... 2: Build: Bump actions/checkout from 3.5.2 to 3.5.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8e5e7e5ab8b370d6c329ec480221332ada57f0ab...c85c95e3d7251135ab7dc9ce3241c5835cc595a9) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Closes gh-5283 Closes gh-5284
* Docs: Fix typos found by codespellDimitri Papadopoulos Orfanos2023-06-284-7/+7
| | | Closes gh-5165
* Build: Drop individual AMD modulesMichał Gołębiowski-Owczarek2023-06-2713-110/+12
| | | | | | | | | | With this change, jQuery build no longer generates the `amd` directory with AMD modules transpiled from source `src` ECMAScript Modules. To use individual jQuery modules from source, ESM is now required. Note that this DOES NOT affect the main `"jquery"` AMD module defined by built jQuery files; those remain supported. Closes gh-5276
* Tests: Disable the ":lang respects escaped backslashes" testMichał Gołębiowski-Owczarek2023-06-271-3/+13
| | | | | | | | | | | Firefox 114+ no longer match on backslashes in `:lang()`, even when escaped. It is an intentional change as `:lang()` parameters are supposed to be valid BCP 47 strings. Therefore, we won't attempt to patch it. We'll keep this test here until other browsers match the behavior. Fixes gh-5271 Closes gh-5277 Ref https://bugzilla.mozilla.org/show_bug.cgi?id=1839747#c1 Ref https://github.com/w3c/csswg-drafts/issues/8720#issuecomment-1509242961
* Docs: remove stale gitter badge from readmeTimmy Willison2023-06-231-1/+3
| | | Close gh-5273
* Build: Reference GitHub Actions by commit SHAsGabriela Gutierrez2023-06-132-7/+7
| | | | | | | | | | | | | | | | | | | | | | The SHAs are verified to come from the original repositories and not forks. For reference: https://github.com/github/codeql-action/releases/tag/v2.3.6 https://github.com/github/codeql-action/commit/83f0fe6c4988d98a455712a27f0255212bba9bd4 https://github.com/actions/checkout/releases/tag/v3.5.2 https://github.com/actions/checkout/commit/8e5e7e5ab8b370d6c329ec480221332ada57f0ab https://github.com/actions/cache/releases/tag/v3.3.1 https://github.com/actions/cache/commit/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 https://github.com/actions/setup-node/releases/tag/v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c Fixes gh-5266 Closes gh-5269 Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
* Core: Fix regression in jQuery.text() on HTMLDocument objectsTimo Tijhof2023-06-122-4/+12
| | | | | | | Fixes gh-5264 Closes gh-5265 (cherry picked from commit 44c56f87a31fbc1f43ac575cfd06a0df12073352)
* Selector: Re-expose jQuery.find.{tokenize,select,compile,setDocument}Michał Gołębiowski-Owczarek2023-06-123-5/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. Some other APIs so far only exposed on the `3.x` line are also added back: * `jQuery.find.select` * `jQuery.find.compile` * `jQuery.find.setDocument` In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes gh-5259 Closes gh-5263 Ref gh-5260 Ref jquery/sizzle#242 Ref gh-5113 Ref gh-4395 Ref gh-4406
* Build: Switch the minifier from UglifyJS to TerserMichał Gołębiowski-Owczarek2023-05-314-18/+19
| | | | | | | | | | | | | | | UglifyJS is ES5-only, while Terser supports newer ECMAScript versions. jQuery is authored in ES5 but jQuery 4.x will also have an ESM build that cannot be minified using UglifyJS directly. We could strip the `export` statement, minify via UglifyJS and re-add one but that increases complexity & may not fully play nice with source maps. On the other hand, switching to Terser increases the minfied size by just 324 bytes and the minified gzipped one by just 70 bytes. Such differences largely disappear among bigger size gains from the `3.x-stable` line - around 2.7 KB minified gzipped as of now. Closes gh-5258
* Docs: Remove the "Grunt build" section from the PR templateMichał Gołębiowski-Owczarek2023-05-311-1/+0
| | | | | | | | Now that unit tests are run on GitHub Actions in all three major engines and for multiple custom jQuery builds, the request for PR authors to run unit tests locally and confirm they pass is needless overhead; let's drop the checkbox. Closes gh-5261
* Build: Make the `eslint:dev` task not lint the `dist/` folderMichał Gołębiowski-Owczarek2023-05-311-1/+5
| | | | | | | There was a mistake in paths logic that made the `dist/` folder linted even in the `eslint:dev` task which is run before the build. Fix that by explicitly ignoring the `dist/` folder at the end of the file list. Closes gh-5257
* Deprecated: Define `.hover()` using non-deprecated methodsMichał Gołębiowski-Owczarek2023-05-221-1/+3
| | | | | | Make the deprecated `.hover()` method not rely on other deprecated methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead. Closes gh-5251
* Build: Test on Node.js 20, stop testing on Node.js 14 & 19Michał Gołębiowski-Owczarek2023-05-221-1/+1
| | | Closes gh-5250
* Tests: Indicate Chrome 112 & Safari 16.4 pass the cssHas support testMichał Gołębiowski-Owczarek2023-04-052-15/+27
| | | | | | | | | | | Chrome 112 & Safari 16.4 introduce two changes: * `:has()` is non-forgiving * `CSS.supports( "selector(...)" )` parses everything in a non-forgiving way We no longer care about the latter but the former means the `cssHas` support test now passes. Closes gh-5225
* CSS: Make `offsetHeight( true )`, etc. include negative marginsMichał Gołębiowski-Owczarek2023-04-042-4/+12
| | | | | | | | | | | | This regressed in gh-3656 as the added logic to include scroll gutters in `.innerWidth()` / `.innerHeight()` didn't take negative margins into account. This broke handling of negative margins in `.offsetHeight( true )` and `.offsetWidth( true )`. To fix it, calculate margin delta separately and only add it after the scroll gutter adjustment logic. Fixes gh-3982 Closes gh-5234 Ref gh-3656
* Event: Avoid collisions between jQuery.event.special & Object.prototypeMichał Gołębiowski-Owczarek2023-04-032-2/+22
| | | | | | | This is a follow-up to similar changes to data & event storages from gh-4603. Closes gh-5235 Ref gh-4603
* Event: Simplify the check for saved data in leverageNativeMichał Gołębiowski-Owczarek2023-04-031-1/+1
| | | | | | | | | | Previously, when `leverageNative` handled async events, there was a case where an empty placeholder object was set as a result. Covering both such an object and `false` required a `length` check. However, this is not necessary since gh-5223 and the check was already simplified in other places; this one was missed. Closes gh-5236 Ref gh-5223
* Event: Make trigger(focus/blur/click) work with native handlersMichał Gołębiowski-Owczarek2023-03-272-6/+73
| | | | | | | | | | | | | | | | | | In `leverageNative`, instead of calling `event.stopImmediatePropagation()` which would abort both native & jQuery handlers, set the wrapper's `isImmediatePropagationStopped` property to a function returning `true`. Since for each element + type pair jQuery attaches only one native handler, there is also only one wrapper jQuery event so this achieves the goal: on the target element jQuery handlers don't fire but native ones do. Unfortunately, this workaround doesn't work for handlers on ancestors - since the native event is re-wrapped by a jQuery one on each level of the propagation, the only way to stop it for jQuery was to stop it for everyone via native `stopPropagation()`. This is not a problem for `focus`/`blur` which don't bubble, but it does also stop `click` on checkboxes and radios. We accept this limitation. Fixes gh-5015 Closes gh-5228
* Event: Simulate focus/blur in IE via focusin/focusoutMichał Gołębiowski-Owczarek2023-03-272-166/+258
| | | | | | | | | | | | | | | | | | | | | | | | In IE (all versions), `focus` & `blur` handlers are fired asynchronously but `focusin` & `focusout` are run synchronously. In other browsers, all those handlers are fired synchronously. Asynchronous behavior of these handlers in IE caused issues for IE (gh-4856, gh-4859). We now simulate `focus` via `focusin` & `blur` via `focusout` in IE to avoid these issues. This also let us simplify some tests. This commit also simplifies `leverageNative` - with IE now using `focusin` to simulate `focus` and `focusout` to simulate `blur`, we don't have to deal with async events in `leverageNative`. This also fixes broken `focus` triggers after first triggering it on a hidden element - previously, `leverageNative` assumed that the native `focus` handler not firing after calling the native `focus` method meant it would be handled later, asynchronously, which was not the case (gh-4950). Fixes gh-4856 Fixes gh-4859 Fixes gh-4950 Closes gh-5223 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Ajax: Don't treat array data as binaryMichał Gołębiowski-Owczarek2023-03-212-67/+202
| | | | | | | | | | | | | PR gh-5197 started treating all non-string non-plain-object `data` values as binary. However, `jQuery.ajax` also supports arrays as values of `data`. This change makes regular arrays no longer be considered binary data. Surprisingly, we had no tests for array `data` values; otherwise, we'd detect the issue earlier. This change also adds a few such missing tests. Closes gh-5203 Ref gh-5197
* Build: Only install Playwright dependencies when neededMichał Gołębiowski-Owczarek2023-03-201-1/+1
| | | | | | | | | | | | PR gh-5190 added support for running tests on Playwright WebKit in CI. For efficiency reasons, Playwright dependencies are only installed for the `test:browser` npm script. However, that same script is also used for Firefox ESR testing. This change makes Playwright dependencies installed only for cases where `WebKitHeadless` exists on the list of tested browsers. Closes gh-5204 Ref gh-5190
* Ajax: Allow `processData: true` even for binary dataMichał Gołębiowski-Owczarek2023-03-202-2/+28
| | | | | | | | | | The way gh-5197 implemented binary data handling, `processData` was being explicitly set to `false`. This is expected but it made it impossible to override it to `true`. The new logic will only set `processData` to `false` if it wasn't explicitly passed in original options. Closes gh-5205 Ref gh-5197
* Tests: Test AJAX deprecated event aliases properlyMichał Gołębiowski-Owczarek2023-03-151-5/+5
| | | | | | | | PR gh-5046 erroneously changed AJAX deprecated event alias usage in deprecated tests to `.on()` calls. This change reverses this mistake. Closes gh-5195 Ref gh-5046
* Deferred: Rename `getStackHook` to `getErrorHook`Michał Gołębiowski-Owczarek2023-03-143-12/+15
| | | | | | | | | | | | | | Rename `jQuery.Deferred.getStackHook` to `jQuery.Deferred.getErrorHook` to indicate passing an error instance is usually a better choice - it works with source maps while a raw stack generally does not. In jQuery `3.7.0`, we'll keep both names, marking the old one as deprecated. In jQuery `4.0.0` we'll just keep the new one. This change implements the `4.0.0` version; PR gh-5212 implements the `3.7.0` one. Fixes gh-5201 Closes gh-5211 Ref gh-5212
* Release: add support for md5 sums in windowsTimmy Willison2023-03-091-2/+15
| | | Close gh-5219
* Selector: Stop relying on CSS.supports( "selector(...)" )Michał Gołębiowski-Owczarek2023-02-145-64/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | `CSS.supports( "selector(...)" )` has different semantics than selectors passed to `querySelectorAll`. Apart from the fact that the former returns `false` for unrecognized selectors and the latter throws, `qSA` is more forgiving and accepts some invalid selectors, auto-correcting them where needed - for example, mismatched brackers are auto-closed. This behavior difference is breaking for many users. To add to that, a recent CSSWG resolution made `:is()` & `:where()` the only pseudos with forgiving parsing; browsers are in the process of making `:has()` parsing unforgiving. Taking all that into account, we go back to our previous try-catch approach without relying on `CSS.supports( "selector(...)" )`. The only difference is we detect forgiving parsing in `:has()` and mark the selector as buggy. The PR also updates `playwright-webkit` so that we test against a version of WebKit that already has non-forgiving `:has()`. Fixes gh-5194 Closes gh-5206 Ref gh-5098 Ref gh-5107 Ref w3c/csswg-drafts#7676 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Selector: Backport jQuery selection context logic to selector-nativeMichał Gołębiowski-Owczarek2023-02-1323-414/+516
| | | | | | | | | | | | | | | | | | | | | | This makes: ```js $div.find("div > *") ``` no longer matching children of `$div`. Also, leading combinators now work, e.g.: ```js $div.find( "> *" ); ``` returns children of `$div`. As a result of that, a number of tests are no longer skipped in the `selector-native` mode. Also, rename `rcombinators` to `rleadingCombinator`. Fixes gh-5185 Closes gh-5186 Ref gh-5085
* Build: Bump actions/setup-node from 3.5.1 to 3.6.0dependabot[bot]2023-02-021-1/+1
| | | | | | | | | | | | | | | | | Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.5.1 to 3.6.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3.5.1...v3.6.0) Closes gh-5200 --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Ajax: Support binary data (including FormData)Michał Gołębiowski-Owczarek2023-02-018-5/+109
| | | | | | | | | | | | Two changes have been applied: * prefilters are now applied before data is converted to a string; this allows prefilters to disable such a conversion * a prefilter for binary data is added; it disables data conversion for non-string non-plain-object `data`; for `FormData` bodies, it removes manually-set `Content-Type` header - this is required as browsers need to append their own boundary to the header Ref gh-4150 Closes gh-5197
* Deferred: Respect source maps in jQuery.Deferred.exceptionHookMichał Gołębiowski-Owczarek2023-02-012-5/+5
| | | | | | | | | | | | | | | | | | So far, `jQuery.Deferred.exceptionHook` used to log error message and stack separately. However, that breaks browser applying source maps against the stack trace - most browsers require logging an error instance. This change makes us do exactly that. One drawback of the change is that in IE 11 previously stack was printed directly and now just the error summary; to get to the actual stack trace, three clicks are required. This seems to be a low price to pay for having source maps work in all the other browsers, though. Safari with the new change requires one click to get to the stack trace which sounds manageable. Fixes gh-3179 Closes gh-5192 Ref https://crbug.com/622227
* Ajax: Support `headers` for script transport even when cross-domainMichał Gołębiowski-Owczarek2023-02-012-34/+98
| | | | | | | | | | | | | | | | The AJAX script transport has two versions: XHR + `jQuery.globalEval` or appending a script tag (note that `jQuery.globalEval` also appends a script tag now, but inline). The former cannot support the `headers` option which has so far not been taken into account. For jQuery 3.x, the main consequence was the option not being respected for cross-domain requests. Since in 4.x we use the latter way more often, the option was being ignored in more cases. The transport now checks whether the `headers` option is specified and uses the XHR way unless `scriptAttrs` are specified as well. Fixes gh-5142 Closes gh-5193