]> source.dussan.org Git - jquery.git/log
jquery.git
5 weeks agoDocs: Update CONTRIBUTING.md
Michał Gołębiowski-Owczarek [Mon, 14 Oct 2024 16:40:11 +0000 (18:40 +0200)]
Docs: Update CONTRIBUTING.md

Changes:
1. Update the link to "help wanted" or "patch welcome" issues to only include
   open ones.
2. Replace info about the jQuery Forum & IRC with Matrix & Stack Overflow.
3. Update the test reduction WebKit blog post link.
4. Update the Git clone instructions to not rely on the legacy `git://`
   protocol.
5. Fix a few typos.

Closes gh-5564

(cherry picked from commit 4ef25b0de4a847f14ba2f88e309eaf759e035d78)

6 weeks agoBuild: Enforce ECMAScript 5 in tests via ESLint
neogy-akash [Wed, 9 Oct 2024 16:27:23 +0000 (21:57 +0530)]
Build: Enforce ECMAScript 5 in tests via ESLint

Fixes gh-5542
Closes gh-5563

(cherry picked from commit d74fc265de2bca3060da2e6f5ec00371b16e43ca)

7 weeks agoTests: Switch to an updated fork of promises-aplus-tests
Michał Gołębiowski-Owczarek [Mon, 30 Sep 2024 16:48:46 +0000 (18:48 +0200)]
Tests: Switch to an updated fork of promises-aplus-tests

The upstream package has been unmaintained for years, with dependencies
with long-reported security issues. Switching to a fork allows to resolve
all the security reports against the jQuery development environment.

The fork is maintained by @mgol and has the following changes:
1. The `underscore` dependency has been removed.
2. `sinon` has been updated from v1 to v19.
3. `mocha` has been updated from v2 to v10.

Changes to the source are minimal; it will be easy to rebase the fixes
if the upstream package is ever updated.

In addition to the above, the `q` dependency has been removed.
It's been added in gh-1996 but never really used.

Closes gh-5559

(cherry picked from commit 559bc5ac58cb3494ee936c1ee1a14ada75196c6b)

2 months agoManipulation: Make jQuery.cleanData not skip elements during cleanup
ac-mmi [Tue, 10 Sep 2024 22:18:53 +0000 (03:48 +0530)]
Manipulation: Make jQuery.cleanData not skip elements during cleanup

When passing a result of `getElementByTagsName` to `jQuery.cleanData`, convert
it to an array first. Otherwise, a live NodeList is passed and if any of the
event cleanups remove the element itself, a collection is modified during the
iteration, making `jQuery.cleanData` skip cleanup for some elements.

Fixes gh-5214
Closes gh-5523

Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
(cherry picked from commit 3cad5c435aa2333c39baa55a8bceb2b6bf1e2721)

2 months agoTests: Run tests in Edge in IE mode in GitHub Actions
Michał Gołębiowski-Owczarek [Mon, 9 Sep 2024 16:24:28 +0000 (18:24 +0200)]
Tests: Run tests in Edge in IE mode in GitHub Actions

While Edge in IE mode is not guaranteed to match IE 11 in every aspect,
in practice it generally does. Testing in this mode in GitHub Actions
will allow us to catch most IE-breaking issues at the PR level.

This change also adds missing npm scripts: `test:chrome`, `test:edge`
& `test:ie`.

Closes gh-5540

(cherry picked from commit 6d78c0768d9aa6ba213678724c89af69a1958df6)

2 months agoTests: Run tests on both real Firefox ESRs
Michał Gołębiowski-Owczarek [Fri, 6 Sep 2024 16:49:52 +0000 (18:49 +0200)]
Tests: Run tests on both real Firefox ESRs

1. At the same time, there may be two supported versions of Firefox ESR. Run
   tests on both, installed locally.
2. Contrary to what we did in gh-5547, still run tests on Firefox 115 on
   BrowserStack - on `main`, we deleted it since we support only the versions
   supported upstream. In jQuery 3.x, we're testing on all versions matching ESR
   lines starting with Firefox 48, so for consistency let's keep Firefox 115
   there as well.

Closes gh-5548
Ref gh-5547

2 months agoTests: align mock.php with main branch (sans spacing diffs)
Timmy Willison [Fri, 23 Aug 2024 01:21:43 +0000 (21:21 -0400)]
Tests: align mock.php with main branch (sans spacing diffs)

Ref gh-5531

2 months agoTests: replace dead links in qunit fixture; use https
Timmy Willison [Sun, 11 Aug 2024 15:18:29 +0000 (11:18 -0400)]
Tests: replace dead links in qunit fixture; use https

Ref gh-5531

2 months agoTests: replace express with basic Node server
Timmy Willison [Sun, 11 Aug 2024 15:17:34 +0000 (11:17 -0400)]
Tests: replace express with basic Node server

Closes gh-5531

3 months agoBuild: Bump `actions/setup-node` from 4.0.2 to 4.0.3
dependabot[bot] [Thu, 1 Aug 2024 09:04:29 +0000 (11:04 +0200)]
Build: Bump `actions/setup-node` from 4.0.2 to 4.0.3

Closes gh-5528

Updates `actions/setup-node` from 4.0.2 to 4.0.3
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4.0.2...1e60f620b9541d16bece96c5465dc8ee9832be0b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 55bc35bcd453e1aefb9e893e7e6ebc665b3fbb11)

3 months agoBuild: upgrade dependencies, including requirejs to 2.3.7
Timmy Willison [Tue, 23 Jul 2024 15:53:50 +0000 (11:53 -0400)]
Build: upgrade dependencies, including requirejs to 2.3.7

3 months agoBuild: use --input-type=module in npm scripts
Timmy Willison [Tue, 23 Jul 2024 14:59:06 +0000 (10:59 -0400)]
Build: use --input-type=module in npm scripts

Ref gh-5522

3 months agoRelease: migrate release process to release-it
Timmy Willison [Thu, 27 Jul 2023 15:24:49 +0000 (11:24 -0400)]
Release: migrate release process to release-it

*Authors*
- Checking and updating authors has been migrated
  to a custom script in the repo

*Changelog*
- changelogplease is no longer maintained
- generate changelog in markdown for GitHub releases
- generate changelog in HTML for blog posts
- generate contributors list in HTML for blog posts

*dist*
- clone dist repo, copy files, and commit/push
- commit tag with dist files on main branch;
  remove dist files from main branch after release

*cdn*
- clone cdn repo, copy files, and commit/push
- create versioned and unversioned copies in cdn/
- generate md5 sums and archives for Google and MSFT

*build*
- implement reproducible builds and verify release builds
  * uses the last modified date for the latest commit
  * See https://reproducible-builds.org/
- the verify workflow also ensures all files were
  properly published to the CDN and npm

*docs*
- the new release workflow is documented at build/release/README.md

*verify*
- use the last modified date of the commit before the tag
- use versioned filenames when checking map files on the CDN
- skip factory and package.json files when verifying CDN

*misc*
- now that we don't need the jquery-release script and
  now that we no longer need to build on Node 10, we can
  use ESM in all files in the build folder
- limit certain workflows to the main repo (not forks)
- version has been set to the previously released version 3.7.1,
  as release-it expects
- release-it added the `preReleaseBase` option and we
  now always set it to `1` in the npm script. This is
  a noop for stable releases.
- include post-release script to be run manually after a release,
  with further steps that should be verified manually

Ref jquery/jquery-release#114
Closes gh-5522

4 months agoBuild: Bump the github-actions group with 1 update
dependabot[bot] [Fri, 5 Jul 2024 16:45:08 +0000 (18:45 +0200)]
Build: Bump the github-actions group with 1 update

Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

Updates `actions/checkout` from 4.1.6 to 4.1.7
- [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/a5ac7e51b41094c92402da3b24376905380afc29...692973e3d937129bcbf40652eb9f2f61becf3332)

Closes gh-5515

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 3a98ef91dfa0b4897df7562f40bfd1715f5fc30e)

5 months agoBuild: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7
Timmy Willison [Sat, 15 Jun 2024 13:10:59 +0000 (09:10 -0400)]
Build: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7

- Sinon is already at the latest version that supports IE9.
- Upgraded uglify to 3.7.7, which is the latest that worked with IE9.
  I tried 3.9.4, which we are using in jquery-migrate, and 3.8.1,
  but there were failures in traversing ("Permission denied" errors).
- Upgraded eslint to version 9, which required some changes.
  Mainly, unused arguments in catch expressions error by default in 9+.
  The config now makes use of `caughtErrorsIgnorePattern`,
  which is set to `"^_"`, the same as unused function params.
- Ignored main branch dist files when switching branches.

Closes gh-5508

5 months agoTests: fix supportsScroll feature test in offset
Timmy Willison [Mon, 10 Jun 2024 18:50:28 +0000 (14:50 -0400)]
Tests: fix supportsScroll feature test in offset

- iOS 12 and below do not support scrollTop/Left on the
  window or document. Before 82169df, window.supportsScroll
  was always undefined. There were 2 issues: (1) iOS <=12 do
  support scroll props on the body, so the support test
  wasn't helpful. (2) one test checked the wrong window and
  the value was always undefined, which meant those tests
  never ran in any browser.

Closes gh-5506

5 months agoBuild: improve specificity of eslint config; add ecma versions
Timmy Willison [Mon, 10 Jun 2024 13:01:53 +0000 (09:01 -0400)]
Build: improve specificity of eslint config; add ecma versions

- also added no-implicit-globals rule outside of tests,
  but including dist

Close gh-5504

5 months agoBuild: Bump the github-actions group with 2 updates
dependabot[bot] [Wed, 5 Jun 2024 22:05:28 +0000 (00:05 +0200)]
Build: Bump the github-actions group with 2 updates

Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).

Updates `actions/checkout` from 4.1.2 to 4.1.6
- [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/9bb56186c3b09b4f86b1c65136769dd318469633...a5ac7e51b41094c92402da3b24376905380afc29)

Updates `github/codeql-action` from 3.24.9 to 3.25.8
- [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/1b1aada464948af03b950897e5eb522f92603cc2...2e230e8fe0ad3a14a340ad0815ddb96d599d2aff)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Closes gh-5505

(cherry picked from commit 46b9e4803ec3506e830ea6b49541ea29717ed460)

5 months agoBuild: Group dependabot PRs updating GitHub Actions
Michał Gołębiowski-Owczarek [Wed, 5 Jun 2024 22:00:32 +0000 (00:00 +0200)]
Build: Group dependabot PRs updating GitHub Actions

We have monthly automatic dependabot PRs for GitHub Actions. Unfortunately,
as of now we get a separate PR for every dependency which is a bit spammy
compared to regular commits updating source.

Thankfully, there's now a way to tell dependabot to submit a single PR per
a defined group. This change defines a single group to have a single dependabot
PR for all action updates.

Closes gh-5503

(cherry picked from commit 3cac1465b4b5539bb679a517fbb52e5419c1866e)

5 months agoCSS:Tests: Fix tests & support tests under CSS Zoom (3.x version)
Michał Gołębiowski-Owczarek [Mon, 3 Jun 2024 16:15:39 +0000 (18:15 +0200)]
CSS:Tests: Fix tests & support tests under CSS Zoom (3.x version)

Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes gh-5489
Closes gh-5496
Ref gh-5495

5 months agoTests: Make `:has` selector tests not vulnerable to unrelated failures
Michał Gołębiowski-Owczarek [Wed, 29 May 2024 16:32:27 +0000 (18:32 +0200)]
Tests: Make `:has` selector tests not vulnerable to unrelated failures

Use `assert.selectInFixture` consistently in `:has` tests. Previously, any test
failure that happened before this test run made it fail due to an additional
paragraph with id `qunit-testresult` injected by QUnit.

Closes gh-5497

5 months agoTests: revert concurrency group change
Timmy Willison [Wed, 29 May 2024 15:06:42 +0000 (11:06 -0400)]
Tests: revert concurrency group change

- It's common for us to merge to main and cherry pick to 3.x-stable,
  so it's best if concurrency is shared between branches, which
  is effectively what we had already as it matches on workflow name
  and browser. Ideally, it could also match on the corresponding commit,
  but it seems the commit message is not available in the github context.

Close gh-5493

6 months agoEvent: Increase robustness of an inner native event in leverageNative
Michał Gołębiowski-Owczarek [Mon, 20 May 2024 16:05:19 +0000 (18:05 +0200)]
Event: Increase robustness of an inner native event in leverageNative

In Firefox, alert displayed just before blurring an element dispatches
the native blur event twice which tripped the jQuery logic if a jQuery blur
handler was not attached before the trigger call.

This was because the `leverageNative` logic part for triggering first checked if
setup was done before (which, for example, is done if a jQuery handler was
registered before for this element+event pair) and - if it was not - added
a dummy handler that just returned `true`. The `leverageNative` logic made that
`true` then saved into private data, replacing the previous `saved` array. Since
`true` passed the truthy check, the second native inner handler treated `true`
as an array, crashing on the `slice` call.

The same issue could happen if a handler returning `true` is attached before
triggering. A bare `length` check would not be enough as the user handler may
return an array-like as well. To remove this potential data shape clash, capture
the inner result in an object with a `value` property instead of saving it
directly.

Since it's impossible to call `alert()` in unit tests, simulate the issue by
replacing the `addEventListener` method on a test button with a version that
calls attached blur handlers twice.

Fixes gh-5459
Closes gh-5466
Ref gh-5236

(cherry picked from commit 527fb3dcf0dcde69302a741dfc61cbfa58e99eb0)

6 months agoTests: include github ref in concurrency group
Timmy Willison [Thu, 25 Apr 2024 17:08:13 +0000 (13:08 -0400)]
Tests: include github ref in concurrency group

- fixes cancelled workflows when multiple PRs are merged
  in quick succession to both the main and 3.x-stable branches

Close gh-5482

6 months agoTests: Make the beforeunload event tests work regardless of extensions
Michał Gołębiowski-Owczarek [Wed, 24 Apr 2024 22:24:55 +0000 (00:24 +0200)]
Tests: Make the beforeunload event tests work regardless of extensions

Some browser extensions, like React DevTools, send messages to the content area.
Since our beforeunload event test listens for all messages, it used to catch
those as well, failing the test.

Add a `source` field to the payload JSON and check for it before treating the
message as coming from our own test to make sure the test passes even with such
browser extensions installed.

Closes gh-5478

(cherry picked from commit 399a78ee9fc5802509df462a2851aef1b60b7fbc)

6 months agoDocs: Update remaining HTTP URLs to HTTPS
Michał Gołębiowski-Owczarek [Wed, 24 Apr 2024 22:22:36 +0000 (00:22 +0200)]
Docs: Update remaining HTTP URLs to HTTPS

Update a few remaining HTTP URLs to HTTPS. The only ones left are XMLNS-like
URLs or ones to localhost - those need to stay as-is.

Closes gh-5479

(cherry picked from commit 7cdd8374234b77a3c70dd511a1b06066afb146bb)

7 months agoBuild: Bump actions/cache & actions/checkout
dependabot[bot] [Tue, 2 Apr 2024 21:35:25 +0000 (23:35 +0200)]
Build: Bump actions/cache & actions/checkout

1. Bump actions/cache from 4.0.1 to 4.0.2

Bumps [actions/cache](https://github.com/actions/cache) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/ab5e6d0c87105b4c9c2047343972218f562e4319...0c45773b623bea8c8e75f6c82b208c3cf94ea4f9)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

2. Bump actions/checkout from 4.1.1 to 4.1.2

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [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/b4ffde65f46336ab88eb53be808477a3936bae11...9bb56186c3b09b4f86b1c65136769dd318469633)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Closes gh-5462

Signed-off-by: dependabot[bot] <support@github.com>
(partially cherry picked from commit df1df9503afad78bec3ba5217f9a9efce49fe634)

7 months agoTests: share queue/browser handling for all worker types
Timmy Willison [Mon, 1 Apr 2024 16:34:13 +0000 (12:34 -0400)]
Tests: share queue/browser handling for all worker types

- one queue to rule them all: browserstack, selenium, and jsdom
- retries and hard retries are now supported in selenium
- selenium tests now re-use browsers in the same way as browserstack

Close gh-5465

7 months agoTests: improve diffing for values of different types
Timmy Willison [Wed, 27 Mar 2024 16:18:37 +0000 (12:18 -0400)]
Tests: improve diffing for values of different types

Close gh-5455

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
8 months agoBuild: Bump actions/cache from 4.0.0 to 4.0.1
dependabot[bot] [Sun, 10 Mar 2024 14:36:56 +0000 (10:36 -0400)]
Build: Bump actions/cache from 4.0.0 to 4.0.1

Bumps [actions/cache](https://github.com/actions/cache) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/13aacd865c20de90d75de3b17ebe84f7a17d57d2...ab5e6d0c87105b4c9c2047343972218f562e4319)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Close gh-5424

(cherry picked from commit 68f772e003ee0f39cf0f755070fb4e9ec9e90973)

8 months agoTests: show any and all actual/expected values
Timmy Willison [Fri, 15 Mar 2024 21:44:21 +0000 (17:44 -0400)]
Tests: show any and all actual/expected values

Close gh-5449

8 months agoTests: add diffing to test reporter
Timmy Willison [Thu, 14 Mar 2024 18:28:38 +0000 (14:28 -0400)]
Tests: add diffing to test reporter

Close gh-5446

8 months agoTests: add actual and expected messages to test reporter
Timmy Willison [Thu, 14 Mar 2024 13:05:57 +0000 (09:05 -0400)]
Tests: add actual and expected messages to test reporter

Close gh-5444

8 months agoTests: fix worker restarts for failed browser acknowledgements
Timmy Willison [Mon, 11 Mar 2024 14:51:06 +0000 (10:51 -0400)]
Tests: fix worker restarts for failed browser acknowledgements

Close gh-5441

8 months agoBuild: make compare size cache readable for manual edits
Timmy Willison [Sun, 10 Mar 2024 16:27:22 +0000 (12:27 -0400)]
Build: make compare size cache readable for manual edits

Ref gh-5441

8 months agoBuild: fix size comparison for slim files when the branch is dirty
Timmy Willison [Sun, 10 Mar 2024 16:19:58 +0000 (12:19 -0400)]
Build: fix size comparison for slim files when the branch is dirty

Ref gh-5441

8 months agoBuild: migrate more uses of fs.promises; use node: protocol
Timmy Willison [Sun, 10 Mar 2024 16:19:15 +0000 (12:19 -0400)]
Build: migrate more uses of fs.promises; use node: protocol

Ref gh-5441

8 months agoTests: add --hard-retries option to test runner
Timmy Willison [Mon, 11 Mar 2024 14:45:17 +0000 (10:45 -0400)]
Tests: add --hard-retries option to test runner

- Add the ability to retry by restarting the worker and
  getting a different browser instance, after all
  normal retries have been exhausted. This can sometimes
  be successful when a refresh is not.

Close gh-5439

8 months agoTests: fix cleanup in cases where server doesn't stop
Timmy Willison [Fri, 8 Mar 2024 23:40:55 +0000 (18:40 -0500)]
Tests: fix cleanup in cases where server doesn't stop

8 months agoBuild: drop support for Node 10
Timmy Willison [Fri, 8 Mar 2024 23:18:24 +0000 (18:18 -0500)]
Build: drop support for Node 10

Close gh-5437

8 months agoBuild: add GitHub Actions workflow to update Filestash
Timmy Willison [Fri, 8 Mar 2024 20:13:31 +0000 (15:13 -0500)]
Build: add GitHub Actions workflow to update Filestash

Close gh-5435

8 months agoTests: fix flakey message logs; ignore delete worker failures
Timmy Willison [Tue, 5 Mar 2024 20:50:37 +0000 (15:50 -0500)]
Tests: fix flakey message logs; ignore delete worker failures

Close gh-5431

8 months agoTests: migrate testing infrastructure to minimal dependencies
Timmy Willison [Tue, 5 Mar 2024 18:53:39 +0000 (13:53 -0500)]
Tests: migrate testing infrastructure to minimal dependencies

This is a complete rework of our testing infrastructure. The main goal is to modernize and drop deprecated or undermaintained dependencies (specifically, grunt, karma, and testswarm). We've achieved that by limiting our dependency list to ones that are unlikely to drop support any time soon. The new dependency list includes:

- `qunit` (our trusty unit testing library)
- `selenium-webdriver` (for spinning up local browsers)
- `express` (for starting a test server and adding middleware)
  - express middleware includes uses of `body-parser` and `raw-body`
- `yargs` (for constructing a CLI with pretty help text)
- BrowserStack (for running each of our QUnit modules separately in all of our supported browsers)
  - `browserstack-local` (for opening a local tunnel. This is the same package still currently used in the new Browserstack SDK)
  - We are not using any other BrowserStack library. The newest BrowserStack SDK does not fit our needs (and isn't open source). Existing libraries, such as `node-browserstack` or `browserstack-runner`, either do not quite fit our needs, are under-maintained and out-of-date, or are not robust enough to meet all of our requirements. We instead call the [BrowserStack REST API](https://github.com/browserstack/api) directly.

**BrowserStack**
- automatically retries individual modules in case of test failure(s)
- automatically attempts to re-establish broken tunnels
- automatically refreshes the page in case a test run has stalled
- Browser workers are reused when running isolated modules in the same browser
- runs all browsers concurrently and uses as many sessions as are available under the BrowserStack plan. It will wait for available sessions if there are none.
- supports filtering the available list of browsers by browser name, browser version, device, OS, and OS version (see `npm run test:unit -- --list-browsers` for more info). It will retrieve the latest matching browser available if any of those parameters are not specified. Supports latest and latest-\d+ in place of browser version.
- cleans up after itself (closes the local tunnel, stops the test server, etc.)
- Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables.

**Selenium**
- supports running any local browser as long as the driver is installed, including support for headless mode in Chrome, FF, and Edge
- supports running `basic` tests on the latest [jsdom](https://github.com/jsdom/jsdom#readme), which can be seen in action in this PR (see `test:browserless`)
- Node tests will run as before in PRs and all non-dependabot branches, but now includes tests on real Safari in a GH actions macos image instead of playwright-webkit.
- can run multiple browsers and multiple modules concurrently

Other notes:
- Stale dependencies have been removed and all remaining dependencies have been upgraded with a few exceptions:
  - `sinon`: stopped supporting IE in version 10. But, `sinon` has been updated to 9.x.
  - `husky`: latest does not support Node 10 and runs on `npm install`. Needed for now until git builds are migrated to GitHub Actions.
  - `rollup`: latest does not support Node 10. Needed for now until git builds are migrated to GitHub Actions.
- BrowserStack tests are set to run on each `main` branch commit
- `debug` mode leaves Selenium browsers open whether they pass or fail and leaves browsers with test failures open on BrowserStack. The latter is to avoid leaving open too many sessions.
- This PR includes a workflow to dispatch BrowserStack runs on-demand
- The Node version used for most workflow tests has been upgraded to 20.x
- updated supportjQuery to 3.7.1

Run `npm run test:unit -- --help` for CLI documentation

Close gh-5427

9 months agoBuild: Bump actions/cache from 3.3.2 to 4.0.0
dependabot[bot] [Sun, 11 Feb 2024 00:45:15 +0000 (01:45 +0100)]
Build: Bump actions/cache from 3.3.2 to 4.0.0

Bumps [actions/cache](https://github.com/actions/cache) from 3.3.2 to 4.0.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/704facf57e6136b1bc63b828d79edcd491f0ee84...13aacd865c20de90d75de3b17ebe84f7a17d57d2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Closes gh-5402

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit bf11739f6c6926bc9bc1b5a1460505d3b7ef8b01)

9 months agoTests: Align `middleware-mockerver.js` with the `main` branch
Michał Gołębiowski-Owczarek [Fri, 9 Feb 2024 17:22:07 +0000 (18:22 +0100)]
Tests: Align `middleware-mockerver.js` with the `main` branch

Remove a redundant Express-targeted `resp.set` call from the `script` handler
in `middleware-mockserver.js` as was done on the `main` branch.

Closes gh-5413
Ref gh-5397

9 months agoRelease: use buildDefaultFiles directly and pass version (#5409)
Timmy Willison [Tue, 6 Feb 2024 15:16:05 +0000 (10:16 -0500)]
Release: use buildDefaultFiles directly and pass version (#5409)

- also add the ability to pass VERSION in env to test final builds
- adjust sha regex to account for lack of shas
- set the version on the dist package.json

Close gh-5408

9 months agoRelease: remove scripts and dev deps from dist package.json
Timmy Willison [Mon, 5 Feb 2024 15:38:19 +0000 (10:38 -0500)]
Release: remove scripts and dev deps from dist package.json

- this became necessary due to the addition of the prepare script
- scripts aren't needed and don't work in the dist repo

Close gh-5405

9 months agoRelease: update build command in Release.generateArtifacts
Timmy Willison [Wed, 31 Jan 2024 14:18:57 +0000 (09:18 -0500)]
Release: update build command in Release.generateArtifacts

Close gh-5400

10 months agoBuild: migrate grunt authors to a custom script
Timmy Willison [Tue, 23 Jan 2024 03:12:33 +0000 (22:12 -0500)]
Build: migrate grunt authors to a custom script

- the new script pulls all authors from the Sizzle repo
- added temporary grunt task for releases

Close gh-5396

10 months agoManipulation: Generalize a test to support IE
Richard Gibson [Fri, 12 Jan 2024 23:19:33 +0000 (18:19 -0500)]
Manipulation: Generalize a test to support IE

Ref gh-5378
Closes gh-5391

(cherry picked from commit 88690ebfc8b5ef8b1e444326c664b590ecc0b888)

10 months agoBuild: Bump follow-redirects from 1.15.1 to 1.15.4
dependabot[bot] [Fri, 12 Jan 2024 00:12:52 +0000 (01:12 +0100)]
Build: Bump follow-redirects from 1.15.1 to 1.15.4

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.1 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.1...v1.15.4)

Closes gh-5389

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 56139394705022e4f6756440030ad6f3bf35f5a6)

10 months agoManipulation: Support $el.html(selfRemovingScript)
Richard Gibson [Mon, 8 Jan 2024 17:30:39 +0000 (12:30 -0500)]
Manipulation: Support $el.html(selfRemovingScript)

Don't try to remove a script element that has already removed itself.

Fixes gh-5377
Closes gh-5378

(cherry-picked from commit 937923d9ee8dfd19008447b5059cbd13ee5a23ac)

12 months agoBuild: Bump @babel/traverse & multiple actions
Michał Gołębiowski-Owczarek [Mon, 13 Nov 2023 17:44:30 +0000 (18:44 +0100)]
Build: Bump @babel/traverse & multiple actions

1: Bump actions/cache from 3.3.1 to 3.3.2

Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8...704facf57e6136b1bc63b828d79edcd491f0ee84)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

2: Bump actions/checkout from 3.6.0 to 4.1.1

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.1.
- [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/f43a0e5ff2bd294095638e18286ca9a3d1956744...b4ffde65f46336ab88eb53be808477a3936bae11)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

3: Bump actions/setup-node from 3.8.1 to 4.0.0

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d...8f152de45cc393bb48ce5d89d36b731f54556e65)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

5: Bump @babel/traverse from 7.22.5 to 7.23.2

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Closes gh-5341
Closes gh-5349
Closes gh-5354
Closes gh-5356
Closes gh-5363

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
12 months agoBuild: Don't run CI push workflows for dependabot branches
Michał Gołębiowski-Owczarek [Mon, 13 Nov 2023 17:18:20 +0000 (18:18 +0100)]
Build: Don't run CI push workflows for dependabot branches

Without this change, dependabot PRs run double checks - one set for the `push`
part and one for the `pull_request` part.

Closes gh-5353

(cherry picked from commit 635cb152e7daac658223455aaab2f81204b5b215)

12 months agoTests: Workaround a tr width test issue in old iOS
Michał Gołębiowski-Owczarek [Mon, 13 Nov 2023 17:12:23 +0000 (18:12 +0100)]
Tests: Workaround a tr width test issue in old iOS

Old iOS (<10) always rounds widths down, account for this in tests.

Closes gh-5361
Ref gh-5317
Ref gh-5359

12 months agoCSS: Fix reliableTrDimensions test for initially hidden iframes (3.x)
Michał Gołębiowski-Owczarek [Mon, 6 Nov 2023 23:35:56 +0000 (00:35 +0100)]
CSS: Fix reliableTrDimensions test for initially hidden iframes (3.x)

Also, account for the fact old Firefox (<61) has `null` computed style
for elements in such iframes.

Closes gh-5359
Ref gh-5317
Ref gh-5358

12 months agoCSS: Fix support test results for initially hidden iframes
Stephen Sigwart [Thu, 2 Nov 2023 09:48:08 +0000 (05:48 -0400)]
CSS: Fix support test results for initially hidden iframes

If the iframe is not initially visible, the `scrollboxSize` support test is
failing. jQuery then cached this value and and applied the wrong result
undefinitely.

This breaks jQuery UI's Dialogs inside initially invisible iframes.

Closes gh-5317
Ref jquery/jquery-ui#2176

12 months agoBuild: Update ESLint-related packages, fix linting errors (3.x version)
Michał Gołębiowski-Owczarek [Wed, 1 Nov 2023 23:48:05 +0000 (00:48 +0100)]
Build: Update ESLint-related packages, fix linting errors (3.x version)

The main change is the new rule in `eslint-config-jquery`:
`template-curly-spacing`.

Closes gh-5348
Ref jquery/eslint-config-jquery#21
Ref gh-5347

13 months agoBuild: Run pretest before test:* npm scripts
Michał Gołębiowski-Owczarek [Mon, 16 Oct 2023 16:54:54 +0000 (18:54 +0200)]
Build: Run pretest before test:* npm scripts

Build was already happening in scripts like `test:browser` but those scripts
were missing `pretest`, meaning that running `npm install && npm test:browser`
may have failed if `pretest` wasn't run before or if its results were out of
date.

Even worse, with such stale data some tests may erroneously succeed.

This also removes a separate `pretest` step from GitHub Actions as it's no
longer needed.

Closes gh-5338

(cherry picked from commit 1ad66aeb6d7d94f8e4c8e2286569722ca41f9868)

14 months agoBuild: sort branches in compare_size; last run last
Timmy Willison [Thu, 21 Sep 2023 21:47:18 +0000 (17:47 -0400)]
Build: sort branches in compare_size; last run last

Close gh-5334

14 months agoBuild: migrate most grunt tasks off of grunt (3.x)
Timmy Willison [Wed, 20 Sep 2023 22:18:42 +0000 (18:18 -0400)]
Build: migrate most grunt tasks off of grunt (3.x)

Close gh-5330

- 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 nodemon, which runs `npm run build:all` on `src` changes.

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
- run pretest script in jenkins

---------

Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
14 months agoCore: Simplify code post browser support reduction
Michał Gołębiowski-Owczarek [Tue, 19 Sep 2023 22:54:40 +0000 (00:54 +0200)]
Core: Simplify code post browser support reduction

Summary of the changes:
* 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

(cherry picked from commit 93ca49e6d1ac23fee33b3bc3b7f4d93dd1a25cb7)

14 months agoBuild: Bump actions/checkout & actions/setup-node
dependabot[bot] [Fri, 1 Sep 2023 00:37:59 +0000 (00:37 +0000)]
Build: Bump actions/checkout & actions/setup-node

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
...

Closes gh-5311
Closes gh-5313

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 42e50f8c21fbfd08092ad81add4ac38982ef0841)

14 months agoBuild: Updating the 3.x-stable version to 3.7.2-pre.
Timmy Willison [Mon, 28 Aug 2023 13:39:27 +0000 (09:39 -0400)]
Build: Updating the 3.x-stable version to 3.7.2-pre.

14 months agoRelease: revert change that broke release
Timmy Willison [Mon, 28 Aug 2023 13:30:59 +0000 (09:30 -0400)]
Release: revert change that broke release

https://github.com/jquery/jquery/commit/763ade6dda092709b36d97491951bcae415d91d1#diff-ba51b2c9ce2527b1f191cb2c210748a4f18cccc38893f7ffe1597fb1d23ce027L72

The above change did not work because makeArchives was
not made to return a Promise

14 months agoRelease: update authors
Timmy Willison [Mon, 28 Aug 2023 13:16:52 +0000 (09:16 -0400)]
Release: update authors

16 months agoBuild: Generate the slim build on `grunt` & run `compare_size` on it
Michał Gołębiowski-Owczarek [Mon, 10 Jul 2023 18:45:30 +0000 (20:45 +0200)]
Build: Generate the slim build on `grunt` & run `compare_size` on it

Summary of the changes:
* expand `node_smoke_tests` to test the full & slim builds
* run `compare_size` on all built minified files; don't run it anymore on
  unminified files where they don't provide lots of value

The main goal of this change is to make it easier to compare sizes of both the
full & slim builds between the `3.x-stable` & `main` branches.

Closes gh-5291
Ref gh-5255

(partially cherry-picked from commit 8be4c0e4f89d6c8f780e5937a0534921d8c7815e)

16 months agoCSS: Make the reliableTrDimensions support test work with Bootstrap CSS (3.x version)
Michał Gołębiowski-Owczarek [Mon, 10 Jul 2023 16:26:45 +0000 (18:26 +0200)]
CSS: Make the reliableTrDimensions support test work with Bootstrap CSS (3.x version)

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-5279
Ref gh-5278

16 months agoSelector: Only attach the unload handler in IE & Edge Legacy
Michał Gołębiowski-Owczarek [Mon, 10 Jul 2023 16:25:56 +0000 (18:25 +0200)]
Selector: Only attach the unload handler in IE & Edge Legacy

Both IE & Edge Legacy need the workaround of calling `setDocument()` in an
`unload` handler to avoid "permission denied" errors. However, due to not being
possible to feature-detect this issue, the handler has been applied in all
browsers for windows different than the one in which jQuery was loaded.

jQuery 4.0, which drops Edge Legacy support, guards this workaround with
a `document.documentMode` check. This won't work in the 3.x line due to still
supporting Edge Legacy but we can check for
`document.documentElement.msMatchesSelector` instead as that API is
supported in IE 9+ and all Edge Legacy versions.

Fixes gh-5281
Closes gh-5282
Ref gh-4792

16 months agoBuild: Make sure `*.cjs` & `*.mjs` files use UNIX line endings as well
Michał Gołębiowski-Owczarek [Mon, 10 Jul 2023 16:19:52 +0000 (18:19 +0200)]
Build: Make sure `*.cjs` & `*.mjs` files use UNIX line endings as well

We've had this rule for `*.js` files so far but we now have two new JS
extensions.

Closes gh-5290

(cherry picked from commit 198b41c8c2cd726b875615023b2b37b213040ad3)

16 months agoBuild: switch preferred email for timmywil
Timmy Willison [Mon, 10 Jul 2023 15:51:13 +0000 (11:51 -0400)]
Build: switch preferred email for timmywil

Close gh-5289

16 months agoBuild: Build: Bump actions/checkout from 3.5.2 to 3.5.3
dependabot[bot] [Sat, 1 Jul 2023 00:28:46 +0000 (00:28 +0000)]
Build: 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

(cherry picked from commit 4a13266efd262a92f05d86b71d715885de103e6d)

16 months agoDocs: Fix typos found by codespell
Dimitri Papadopoulos Orfanos [Tue, 27 Jun 2023 22:29:29 +0000 (00:29 +0200)]
Docs: Fix typos found by codespell

Closes gh-5165

(cherry picked from commit 620870a1af5287d29c77ec6d5f973116b23793a7)

16 months agoTests: Disable the ":lang respects escaped backslashes" test
Michał Gołębiowski-Owczarek [Tue, 27 Jun 2023 16:05:46 +0000 (18:05 +0200)]
Tests: Disable the ":lang respects escaped backslashes" test

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

(cherry picked from commit 62b9a2583460c2384f6de1d0a6aeaf05e51d523b)

17 months agoDocs: remove stale gitter badge from readme
Timmy Willison [Fri, 23 Jun 2023 13:43:03 +0000 (09:43 -0400)]
Docs: remove stale gitter badge from readme

Close gh-5274

17 months agoBuild: Reference GitHub Actions by commit SHAs
Gabriela Gutierrez [Tue, 13 Jun 2023 21:22:07 +0000 (21:22 +0000)]
Build: Reference GitHub Actions by commit SHAs

The SHAs are verified to come from the original repositories and not forks.

For reference:

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>
(cherry picked from commit 784b9ba6e403997161113aa56d1747baed4e0767)

17 months agoTests: Skip a new `.text()` test in IE 9
Michał Gołębiowski-Owczarek [Mon, 12 Jun 2023 21:52:30 +0000 (23:52 +0200)]
Tests: Skip a new `.text()` test in IE 9

The test depends on `DOMParser`'s `parseFromString` called with `text/html`
which is not supported in IE 9.

17 months agoCore: Fix regression in jQuery.text() on HTMLDocument objects
Timo Tijhof [Mon, 12 Jun 2023 21:12:15 +0000 (22:12 +0100)]
Core: Fix regression in jQuery.text() on HTMLDocument objects

Fixes gh-5264
Closes gh-5265

17 months agoSelector: Re-expose jQuery.find.tokenize (3.x version)
Michał Gołębiowski-Owczarek [Mon, 12 Jun 2023 20:58:58 +0000 (22:58 +0200)]
Selector: Re-expose jQuery.find.tokenize (3.x version)

`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.

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-5260
Ref gh-5263
Ref jquery/sizzle#242
Ref gh-5113
Ref gh-4395
Ref gh-4406

17 months agoDocs: Remove the "Grunt build" section from the PR template
Michał Gołębiowski-Owczarek [Wed, 31 May 2023 16:57:13 +0000 (18:57 +0200)]
Docs: Remove the "Grunt build" section from the PR template

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

(cherry picked from commit 988a56847de301ce18a653f84b07c5af432a269f)

18 months agoDeprecated: Define `.hover()` using non-deprecated methods
Michał Gołębiowski-Owczarek [Mon, 22 May 2023 16:23:19 +0000 (18:23 +0200)]
Deprecated: Define `.hover()` using non-deprecated methods

Make the deprecated `.hover()` method not rely on other deprecated
methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead.

Closes gh-5251

(cherry picked from commit fd6ffc5eb2c12562f2656d2f33865448420252be)

18 months agoBuild: Test on Node.js 20, stop testing on Node.js 14 & 19
Michał Gołębiowski-Owczarek [Mon, 22 May 2023 14:21:35 +0000 (16:21 +0200)]
Build: Test on Node.js 20, stop testing on Node.js 14 & 19

Closes gh-5250

(cherry picked from commit 6616acff0a6c144c3eac3afae8578085bd325834)

18 months agoBuild: Updating the 3.x-stable version to 3.7.1-pre.
Timmy Willison [Thu, 11 May 2023 18:32:04 +0000 (14:32 -0400)]
Build: Updating the 3.x-stable version to 3.7.1-pre.

19 months agoTests: Indicate Chrome 112 & Safari 16.4 pass the cssHas support test (3.x version)
Michał Gołębiowski-Owczarek [Tue, 4 Apr 2023 22:44:01 +0000 (00:44 +0200)]
Tests: Indicate Chrome 112 & Safari 16.4 pass the cssHas support test (3.x version)

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-5226

19 months agoCSS: Make `offsetHeight( true )`, etc. include negative margins
Michał Gołębiowski-Owczarek [Tue, 4 Apr 2023 14:00:55 +0000 (16:00 +0200)]
CSS: Make `offsetHeight( true )`, etc. include negative margins

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

(cherry picked from commit bce13b72c1753e16cc0db53ebf0f0456bdcf6b48)

19 months agoEvent: Simplify the check for saved data in leverageNative
Michał Gołębiowski-Owczarek [Mon, 3 Apr 2023 16:21:15 +0000 (18:21 +0200)]
Event: Simplify the check for saved data in leverageNative

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

(cherry picked from commit dfe212d5a1eed6b4a67d1cbd04ece09bbac33699)

19 months agoSelector: Remove an obsolete comment
Michał Gołębiowski-Owczarek [Mon, 3 Apr 2023 16:16:43 +0000 (18:16 +0200)]
Selector: Remove an obsolete comment

There was a comment claiming that there are two implementations
of `safeActiveElement`. However, the one in `event.js` got removed
in gh-5224, even before the comment was added.

This commit removes this obsolete comment.

Closes gh-5237
Ref gh-5224

19 months agoTests: Fix tests added in gh-5233
Michał Gołębiowski-Owczarek [Mon, 27 Mar 2023 20:54:35 +0000 (22:54 +0200)]
Tests: Fix tests added in gh-5233

19 months agoCSS: Add missing jQuery.cssNumber entries
Michał Gołębiowski-Owczarek [Mon, 27 Mar 2023 19:50:26 +0000 (21:50 +0200)]
CSS: Add missing jQuery.cssNumber entries

New entries cover `aspect-ratio`, `scale`, and a few others.

Also, remove quotes around `cssNumber` keys

A few properties have been taken from React:
https://github.com/facebook/react/blob/afea1d0c536e0336735b0ea5c74f635527b65785/packages/react-dom-bindings/src/shared/CSSProperty.js\#L8-L58

Fixes gh-5179
Closes gh-5233

19 months agoSelector: Wrap activeElement access in try-catch
Michał Gołębiowski-Owczarek [Mon, 27 Mar 2023 19:48:38 +0000 (21:48 +0200)]
Selector: Wrap activeElement access in try-catch

In IE 9 accessing `document.activeElement` may throw; see
https://bugs.jquery.com/ticket/13393. We've already guarded
against this in event code but not in selector.

Closes gh-5229

19 months agoEvent: Make trigger(focus/blur/click) work with native handlers
Michał Gołębiowski-Owczarek [Mon, 27 Mar 2023 19:47:01 +0000 (21:47 +0200)]
Event: Make trigger(focus/blur/click) work with native handlers

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

(cherry picked from commit 6ad3651dbfea9e9bb56e608f72b4ef2f97bd4e70)

19 months agoEvent: Simulate focus/blur in IE via focusin/focusout (3.x version)
Michał Gołębiowski-Owczarek [Mon, 27 Mar 2023 19:24:42 +0000 (21:24 +0200)]
Event: Simulate focus/blur in IE via focusin/focusout (3.x version)

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).

To preserve relative `focusin`/`focus` & `focusout`/`blur` event order
guaranteed on the 3.x branch, attach a single handler for both events in IE.

A side effect of this is that to reduce size the `event/focusin` module
no longer exists and it's impossible to disable the `focusin` patch
in modern browsers via the jQuery custom build system.

Fixes gh-4856
Fixes gh-4859
Fixes gh-4950
Ref gh-5223
Closes gh-5224

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
20 months agoTests: Add tests for arary data in ajax
Michał Gołębiowski-Owczarek [Mon, 6 Feb 2023 17:52:58 +0000 (18:52 +0100)]
Tests: Add tests for arary data in ajax

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 didn't land on `3.x-stable`;
however... Surprisingly, we had no tests for array `data` values.
This change backports a few such missing tests added in gh-5203.

Ref gh-5197
Ref gh-5203

20 months agoBuild: Only install Playwright dependencies when needed
Michał Gołębiowski-Owczarek [Mon, 20 Mar 2023 16:13:31 +0000 (17:13 +0100)]
Build: Only install Playwright dependencies when needed

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

(cherry picked from commit e77bd9d64fc696cadfe1f8c9ebb50d7609a97b07)

20 months agoTests: Skip jQuery.Deferred.exceptionHook tests in IE 9
Michał Gołębiowski-Owczarek [Wed, 15 Mar 2023 11:21:35 +0000 (12:21 +0100)]
Tests: Skip jQuery.Deferred.exceptionHook tests in IE 9

The non-deprecated test was already skipped there, the deprecated
one is now skipped as well.

Ref gh-5212

20 months agoTests: Test AJAX deprecated event aliases properly
Michał Gołębiowski-Owczarek [Wed, 15 Mar 2023 10:44:08 +0000 (11:44 +0100)]
Tests: Test AJAX deprecated event aliases properly

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

(cherry picked from commit cff2899885c314d32eea42e9eef6ead6e5da5c2f)

20 months agoDeferred: Rename `getStackHook` to `getErrorHook` (3.x version)
Michał Gołębiowski-Owczarek [Tue, 14 Mar 2023 21:32:57 +0000 (22:32 +0100)]
Deferred: Rename `getStackHook` to `getErrorHook` (3.x version)

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 `3.7.0` version; PR gh-5211 implements
the `4.0.0` one.

Fixes gh-5201
Closes gh-5212
Ref gh-5211

20 months agoRelease: add support for md5 sums in windows
Timmy Willison [Thu, 9 Mar 2023 20:19:28 +0000 (15:19 -0500)]
Release: add support for md5 sums in windows

Close gh-5220

21 months agoSelector: Stop relying on CSS.supports( "selector(...)" )
Michał Gołębiowski-Owczarek [Tue, 14 Feb 2023 10:42:29 +0000 (11:42 +0100)]
Selector: Stop relying on CSS.supports( "selector(...)" )

`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-5207
Ref gh-5206
Ref gh-5098
Ref gh-5107
Ref w3c/csswg-drafts#7676

21 months agoSelector: Rename rcombinators to rleadingCombinator
Michał Gołębiowski-Owczarek [Mon, 13 Feb 2023 17:35:02 +0000 (18:35 +0100)]
Selector: Rename rcombinators to rleadingCombinator

Closes gh-5208