]> source.dussan.org Git - jquery.git/log
jquery.git
4 years agoTests: Remove remaining obsolete jQuery.cache references
Michał Gołębiowski-Owczarek [Mon, 18 May 2020 16:43:01 +0000 (18:43 +0200)]
Tests: Remove remaining obsolete jQuery.cache references

PR gh-4586 removed some of those but not all.

Closes gh-4715
Ref gh-4586

(cherry picked from commit d96111e18b42ae1bc7def72a8a0d156ea39e4d0e)

4 years agoTests: Remove obsolete jQuery data tests
Michał Gołębiowski-Owczarek [Mon, 13 Jan 2020 18:23:01 +0000 (19:23 +0100)]
Tests: Remove obsolete jQuery data tests

The tests relied on `jQuery.cache` so they only ever worked in jQuery 1.x.

Closes gh-4586

(cherry picked from commit eb35be528fdea40faab4d89ac859d38dfd024271)

4 years agoDocs: Change JS Foundation mentions to OpenJS Foundation
Michał Gołębiowski-Owczarek [Mon, 18 May 2020 16:41:32 +0000 (18:41 +0200)]
Docs: Change JS Foundation mentions to OpenJS Foundation

Closes gh-4711

(cherry picked from 11611967adf2bd9ff4304132f917629ec1134049)

4 years agoBuild: Correct code indentations based on jQuery Style Guide
Wonseop Kim [Tue, 5 May 2020 08:49:27 +0000 (17:49 +0900)]
Build: Correct code indentations based on jQuery Style Guide

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)

4 years agoBuild: Updating the 3.x-stable version to 3.5.2-pre.
Timmy Willison [Mon, 4 May 2020 22:51:05 +0000 (18:51 -0400)]
Build: Updating the 3.x-stable version to 3.5.2-pre.

4 years agoRelease: update AUTHORS.txt
Timmy Willison [Mon, 4 May 2020 21:51:40 +0000 (17:51 -0400)]
Release: update AUTHORS.txt

4 years agoTests: Workaround failures in recent XSS tests in iOS 8 - 12
Michał Gołębiowski-Owczarek [Thu, 30 Apr 2020 19:25:29 +0000 (21:25 +0200)]
Tests: Workaround failures in recent XSS tests in iOS 8 - 12

iOS 8-12 parses `<noembed>` tags differently, executing this code. This is no
different to native behavior on that OS, though, so just accept it.

Ref gh-4685
Closes gh-4694

(cherry picked from commit 11066a9e6ac183dd710d1bc7aa74a3f809757136)

4 years agoDocs: Fix typos
Pierre Grimaud [Wed, 29 Apr 2020 19:18:23 +0000 (21:18 +0200)]
Docs: Fix typos

Closes gh-4686

(cherry picked from commit 1a7332ce83cdee7d6cd9d45c2a4b83067f53f14b)

4 years agoTests: Add tests for recently fixed manipulation XSS issues
Michał Gołębiowski-Owczarek [Wed, 29 Apr 2020 14:39:04 +0000 (16:39 +0200)]
Tests: Add tests for recently fixed manipulation XSS issues

Closes gh-4685
Ref gh-4642
Ref gh-4647

(cherry picked from commit dc06d68bdc4c2562b5cc530f21e668a17d78ee2d)

4 years agoTests: Cleanup `window` & `document` handlers in a new event test
Michał Gołębiowski-Owczarek [Mon, 27 Apr 2020 19:37:06 +0000 (21:37 +0200)]
Tests: Cleanup `window` & `document` handlers in a new event test

The "focusin on document & window" test didn't cleanup `focusout` handlers
on `window` & `document`. This has been fixed.

Ref gh-4657

4 years agoTests: Fix flakiness in the "jQuery.ajax() - JSONP - Same Domain" test
Michał Gołębiowski-Owczarek [Mon, 27 Apr 2020 18:22:39 +0000 (20:22 +0200)]
Tests: Fix flakiness in the "jQuery.ajax() - JSONP - Same Domain" test

The "jQuery.ajax() - JSONP - Same Domain" test is firing a request with
a duplicate "callback" parameter, something like (simplified):
```
mock.php?action=jsonp&callback=jQuery_1&callback=jQuery_2
```

There was a difference in how the PHP & Node.js implementations of the jsonp
action in the mock server handled situations like that. The PHP implementation
was using the latest parameter while the Node.js one was turning it into an
array but the code didn't handle this situation. Because of how JavaScript
stringifies arrays, while the PHP implementation injected the following code:
```js
jQuery_2(payload)
```
the Node.js one was injecting the following one:
```js
jQuery_1,jQuery_2(payload)
```
This is a comma expression in JavaScript; it so turned out that in the majority
of cases both callbacks were identical so it was more like:
```js
jQuery_1,jQuery_1(payload)
```
which evaluates to `jQuery_1(payload)` when `jQuery_1` is defined, making the
test go as expected. In many cases, though, especially on Travis, the callbacks
were different, triggering an `Uncaught ReferenceError` error & requiring
frequent manual re-runs of Travis builds.

This commit fixes the logic in the mock Node.js server, adding special handling
for arrays.

Closes gh-4687

(cherry picked from commit 7b0864d0539bbfbb01d88d9bc95369580ffd99bc)

4 years agoDocs: Update the link to the jsdom repository
Michał Gołębiowski-Owczarek [Sat, 25 Apr 2020 18:47:25 +0000 (20:47 +0200)]
Docs: Update the link to the jsdom repository

Closes gh-4684

(cherry picked from commit a62309e01b3c76d2b73560ca666c454b7bbfcb77)

4 years agoBuild: Test on Node.js 14, stop testing on Node.js 8 & 13
Michał Gołębiowski-Owczarek [Thu, 23 Apr 2020 11:24:35 +0000 (13:24 +0200)]
Build: Test on Node.js 14, stop testing on Node.js 8 & 13

Closes gh-4678

(cherry picked from commit 88eb22e0599d546f98f6145c53deb086e1d82857)

4 years agoBuild: Enable reportUnusedDisableDirectives in ESLint
Ed S [Mon, 20 Apr 2020 17:01:20 +0000 (18:01 +0100)]
Build: Enable reportUnusedDisableDirectives in ESLint

This forbids unnecessary `eslint-disable` comments.

Ref gh-4095
Closes gh-4520

(cherry picked from 46f9810b73a7ad446d7c3711faf92f56b67df3c1)

4 years agoData: Make the data object a regular object again
Michał Gołębiowski-Owczarek [Mon, 20 Apr 2020 16:11:18 +0000 (18:11 +0200)]
Data: Make the data object a regular object again

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

4 years agoDocs: Use https for hyperlinks in README
Jonathan [Fri, 17 Apr 2020 09:46:49 +0000 (11:46 +0200)]
Docs: Use https for hyperlinks in README

Closes gh-4673

(cherry picked from commit 73415da25d964ee31ec1804d55f5af0199a1378e)

4 years agoBuild: Updating the 3.x-stable version to 3.5.1-pre.
Michał Gołębiowski-Owczarek [Fri, 10 Apr 2020 15:47:07 +0000 (17:47 +0200)]
Build: Updating the 3.x-stable version to 3.5.1-pre.

4 years agoRelease: Update AUTHORS.txt
Michał Gołębiowski-Owczarek [Fri, 10 Apr 2020 14:45:30 +0000 (16:45 +0200)]
Release: Update AUTHORS.txt

4 years agoAjax: Do not execute scripts for unsuccessful HTTP responses
Sean Robinson [Fri, 26 Apr 2019 14:25:08 +0000 (07:25 -0700)]
Ajax: Do not execute scripts for unsuccessful HTTP responses

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

4 years agoAjax: Overwrite s.contentType with content-type header value, if any
Christian Wenz [Mon, 6 Apr 2020 19:15:55 +0000 (21:15 +0200)]
Ajax: Overwrite s.contentType with content-type header value, if any

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>
4 years agoTests: Blacklist one focusin test in IE
Michał Gołębiowski-Owczarek [Mon, 6 Apr 2020 18:56:02 +0000 (20:56 +0200)]
Tests: Blacklist one focusin test in IE

The main part of the test was checking that focusin handling in an iframe works
and that's still checked. The test was also checking that it doesn't propagate
to the parent document, though, and, apparently, in IE it does. This one test
is now blacklisted in IE.

4 years agoEvent: Use only one focusin/out handler per matching window & document
Michał Gołębiowski-Owczarek [Mon, 6 Apr 2020 18:34:40 +0000 (20:34 +0200)]
Event: Use only one focusin/out handler per matching window & document

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

4 years agoManipulation: Skip the select wrapper for <option> outside of IE 9
Michał Gołębiowski-Owczarek [Mon, 30 Mar 2020 18:15:09 +0000 (20:15 +0200)]
Manipulation: Skip the select wrapper for <option> outside of IE 9

Closes gh-4647

4 years agoManipulation: Make jQuery.htmlPrefilter an identity function
Michał Gołębiowski-Owczarek [Mon, 16 Mar 2020 20:49:29 +0000 (21:49 +0100)]
Manipulation: Make jQuery.htmlPrefilter an identity function

Closes gh-4642

(cherry picked from 90fed4b453a5becdb7f173d9e3c1492390a1441f)

4 years agoSelector: Update Sizzle from 2.3.4 to 2.3.5
Michał Gołębiowski-Owczarek [Mon, 16 Mar 2020 16:34:27 +0000 (17:34 +0100)]
Selector: Update Sizzle from 2.3.4 to 2.3.5

Fixes gh-4424
Fixes gh-4435
Fixes gh-4441
Fixes gh-4453
Closes gh-4641

4 years agoBuild: Resolve Travis config warnings
Michał Gołębiowski-Owczarek [Fri, 13 Mar 2020 16:16:07 +0000 (17:16 +0100)]
Build: Resolve Travis config warnings

Travis reports warnings in our config:
* root: deprecated key sudo (The key `sudo` has no effect anymore.)
* root: missing os, using the default linux
* root: key matrix is an alias for jobs, using jobs

They are all now resolved.

Closes gh-4636

(cherry picked from commit 5b94a4f847fe2328b1b8f2340b11b6031f95d2d1)

4 years agoData:Event:Manipulation: Prevent collisions with Object.prototype
Michał Gołębiowski-Owczarek [Mon, 2 Mar 2020 22:02:42 +0000 (23:02 +0100)]
Data:Event:Manipulation: Prevent collisions with Object.prototype

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)

4 years agoRelease: Use an in-repository dist README fixture
Michał Gołębiowski-Owczarek [Mon, 2 Mar 2020 21:42:38 +0000 (22:42 +0100)]
Release: Use an in-repository dist README fixture

Use a dist README fixture kept in the jQuery repository instead of modifying
an existing one. This makes the jQuery repository the single source of truth
when it comes to jQuery releases and it makes it easier to make changes to
README without worrying how it will affect older jQuery lines.

The commit also ES6ifies build/release.js & build/release/dist.js

Closes gh-4614

(cherry picked from commit 358b769a00c3a09a8ec621b8dcb2d5e31b7da69a)

4 years agoBuild: Enable ESLint one-var rule for var declarations in browser code
Michał Gołębiowski-Owczarek [Mon, 2 Mar 2020 21:25:35 +0000 (22:25 +0100)]
Build: Enable ESLint one-var rule for var declarations in browser code

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)

4 years agoTests: Pass a number of necessary done() calls to assert.async()
Michał Gołębiowski-Owczarek [Mon, 2 Mar 2020 21:15:06 +0000 (22:15 +0100)]
Tests: Pass a number of necessary done() calls to assert.async()

It is no longer needed to create `done` wrappers in tests that require
multiple async operations to complete.

Closes gh-4633

(cherry picked from commit 364476c3dc1231603ba61fc08068fa89fb095e1a)

4 years agoBuild: Test the no-Sizzle build on Travis
Michał Gołębiowski-Owczarek [Mon, 2 Mar 2020 19:43:11 +0000 (20:43 +0100)]
Build: Test the no-Sizzle build on Travis

Closes gh-4635

4 years agoBuild: Update .mailmap & AUTHORS.txt
Michał Gołębiowski-Owczarek [Mon, 24 Feb 2020 21:25:43 +0000 (22:25 +0100)]
Build: Update .mailmap & AUTHORS.txt

Partially based on gh-4613.

Ref gh-4613
Ref 721744a9fab5b597febea64e466272eabfdb9463

4 years agoCore:Ajax: Align nonce & global with master, fix an AMD issue
Michał Gołębiowski-Owczarek [Mon, 24 Feb 2020 18:10:03 +0000 (19:10 +0100)]
Core:Ajax: Align nonce & global with master, fix an AMD issue

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

4 years agoCore: Fire iframe script in its context, add doc param in globalEval
Michał Gołębiowski-Owczarek [Mon, 10 Feb 2020 18:17:22 +0000 (19:17 +0100)]
Core: Fire iframe script in its context, add doc param in globalEval

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)

4 years agoBuild:Tests: Fix custom build tests, verify on Travis; name Travis jobs
Michał Gołębiowski-Owczarek [Mon, 27 Jan 2020 17:54:47 +0000 (18:54 +0100)]
Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs

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

4 years agoAjax: Deprecate AJAX event aliases, inline event/alias into deprecated
Michał Gołębiowski-Owczarek [Tue, 21 Jan 2020 13:12:35 +0000 (14:12 +0100)]
Ajax: Deprecate AJAX event aliases, inline event/alias into deprecated

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)

4 years agoBuild: Lint the minified jQuery file as well
Michał Gołębiowski-Owczarek [Tue, 21 Jan 2020 12:51:03 +0000 (13:51 +0100)]
Build: Lint the minified jQuery file as well

While we have absolutely no style-related expectations to our minified file,
we do care that it's valid ES 5.1. This is now verified.

Also, update grunt-eslint as a newer ESLint version is required to be able
to use "extends" inside of the "overrides" section.

Fixes gh-3075
Closes gh-4594
Ref gh-4598

4 years agoBuild: Make Karma work in AMD mode
Michał Gołębiowski-Owczarek [Tue, 21 Jan 2020 12:26:47 +0000 (13:26 +0100)]
Build: Make Karma work in AMD mode

Also, run such a suite in CI to make sure modules are working as expected
when used directly.

(partially cherry picked from 341c6d1b5abe4829f59fbc32e93f6a6a1afb900f)
(partially cherry picked from 437f389a24a6bef213d4df507909e7e69062300b)

Closes gh-4595
Ref gh-4550
Ref gh-4574

4 years agoDocs: Update links to EdgeHTML issues to go through Web Archive
Michał Gołębiowski-Owczarek [Tue, 7 Jan 2020 22:45:41 +0000 (23:45 +0100)]
Docs: Update links to EdgeHTML issues to go through Web Archive

With Microsoft going Chromium with Edge, its old EdgeHTML issues were all
removed. :(

The commit also reformats one manipulation unit test to use tabs instead
of spaces for indentation.

(partially cherry-picked from 1dad1185e0b2ca2a13bf411558eda75fb2d4da88)

Closes gh-4584

4 years agoTests: Make the support tests pass on Firefox 4x/5x/60
Michał Gołębiowski-Owczarek [Tue, 7 Jan 2020 16:05:14 +0000 (17:05 +0100)]
Tests: Make the support tests pass on Firefox 4x/5x/60

The check for old Firefox versions with different support test result only
checked for Firefox 52 or 60. It now checks for 4x/5x/60 to understand more
versions.

Closes gh-4583

4 years agoBuild: Create a `grunt custom:slim` alias for the Slim build
Michał Gołębiowski-Owczarek [Tue, 7 Jan 2020 15:42:49 +0000 (16:42 +0100)]
Build: Create a `grunt custom:slim` alias for the Slim build

Closes gh-4578

(cherry-picked from 9b9ed469b43e9fa6e2c752444470ae4c87d03d57)

4 years agoEvent: Only attach events to objects that accept data - for real
Michał Gołębiowski-Owczarek [Mon, 9 Dec 2019 18:50:14 +0000 (19:50 +0100)]
Event: Only attach events to objects that accept data - for real

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

4 years agoTests: Skip a "width/height on a table row with phantom borders" test in Firefox
Michał Gołębiowski-Owczarek [Mon, 28 Oct 2019 19:38:33 +0000 (20:38 +0100)]
Tests: Skip a "width/height on a table row with phantom borders" test in Firefox

Firefox 70 & newer fail this test but the issue there is more profound - Firefox
doesn't subtract borders from table row computed widths.

Closes gh-4537
Ref jquery/jquery#4529
Ref https://bugzilla.mozilla.org/show_bug.cgi?id=1590837
Ref w3c/csswg-drafts#4444

4 years agoTests: Don't test synchronous XHR on unload in Chrome
Michał Gołębiowski-Owczarek [Mon, 28 Oct 2019 19:27:49 +0000 (20:27 +0100)]
Tests: Don't test synchronous XHR on unload in Chrome

Chrome 78 dropped support for synchronous XHR requests inside of
beforeunload, unload, pagehide, and visibilitychange event handlers.
See https://bugs.chromium.org/p/chromium/issues/detail?id=952452

Closes gh-4536

4 years agoBuild: Run tests on Travis only on browsers defined in the config
Michał Gołębiowski-Owczarek [Tue, 22 Oct 2019 18:49:37 +0000 (20:49 +0200)]
Build: Run tests on Travis only on browsers defined in the config

The environmental variable BROWSERS was being created but it wasn't read in the
list of browsers to pass to Karma.

Closes gh-4532

(cherry picked from commit bcbcdd2b2c1bb7075f4f73dc89ca7d65db2a09ed)

4 years agoBuild: Run tests on Firefox ESR as well
Michał Gołębiowski-Owczarek [Tue, 22 Oct 2019 18:20:53 +0000 (20:20 +0200)]
Build: Run tests on Firefox ESR as well

Closes gh-4530

4 years agoBuild: Run tests on Node.js 13 in addition to 8, 10 & 12
Michał Gołębiowski-Owczarek [Tue, 22 Oct 2019 18:03:36 +0000 (20:03 +0200)]
Build: Run tests on Node.js 13 in addition to 8, 10 & 12

Closes gh-4528

(cherry picked from commit 830976e690b5fffeac860e2fdd07986d087ce824)

4 years agoBuild: Drop workarounds for Node.js 6 in Gruntfile.js
Michał Gołębiowski-Owczarek [Tue, 22 Oct 2019 18:09:15 +0000 (20:09 +0200)]
Build: Drop workarounds for Node.js 6 in Gruntfile.js

4 years agoBuild: Run tests on Travis on FirefoxHeadless as well
Michał Gołębiowski-Owczarek [Mon, 21 Oct 2019 17:06:39 +0000 (19:06 +0200)]
Build: Run tests on Travis on FirefoxHeadless as well

Also, run them on both ChromeHeadless & FirefoxHeadless locally on
`grunt karma:main`.

Plus, so far, the chrome addons were installed for all the jobs, even
the ones that weren't used for browser testing. Changing that makes
those jobs faster.

(cherry-picked from 84835e68239ce55d1fc007b284e8ef4ed2817c2)

4 years agoOffset: Send px-ed strings to .css()
Dave Methvin [Mon, 21 Oct 2019 16:53:24 +0000 (12:53 -0400)]
Offset: Send px-ed strings to .css()

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

5 years agoCSS: Workaround buggy getComputedStyle on table rows in IE/Edge
Michał Gołębiowski-Owczarek [Mon, 14 Oct 2019 16:34:06 +0000 (18:34 +0200)]
CSS: Workaround buggy getComputedStyle on table rows in IE/Edge

Fixes gh-4490
Closes gh-4503

5 years agoBuild: Require strict mode in Node.js scripts via ESLint
Michał Gołębiowski-Owczarek [Tue, 8 Oct 2019 22:17:55 +0000 (00:17 +0200)]
Build: Require strict mode in Node.js scripts via ESLint

So far, only browser-based JS files were required to be in strict mode (in the
function form). This commit adds such a requirement to Node.js scripts where
the global form is preferred. All Node.js scripts in sloppy mode were
converted to strict mode.

Closes gh-4499

(cherry picked from commit bbad821c399da92995a11b88d6684970479d4a9b)

5 years agoDocs: Convert link to Homebrew from HTTP to HTTPS
Christian Oliff [Mon, 7 Oct 2019 06:45:40 +0000 (15:45 +0900)]
Docs: Convert link to Homebrew from HTTP to HTTPS

`http://brew.sh/` -> `https://brew.sh/`

Closes gh-4501

(cherry picked from commit e0022f23144fd1dc6db86a5d8c18af47bc14f0f3)

5 years agoBuild: Support jquery-release --dry-run flag
Michał Gołębiowski-Owczarek [Sat, 5 Oct 2019 16:48:27 +0000 (18:48 +0200)]
Build: Support jquery-release --dry-run flag

Without this change passing `--dry-run` to jquery-release still pushes to the
jquery-dist repository which is dangerous as one can assume `--dry-run` to be
safe from external side effects.

Close gh-4498

(cherry picked from commit d7d0b52bda74486f2351baa9d03ca4534de0d733)

5 years agoBuild: Stop copying src/core.js to dist on release
Michał Gołębiowski-Owczarek [Fri, 4 Oct 2019 14:13:14 +0000 (16:13 +0200)]
Build: Stop copying src/core.js to dist on release

File `src/core.js` has started erroneously being copied to `dist/` in gh-2981.

Fixes gh-4489
Closes gh-4492
Ref gh-2979
Ref gh-2981

(cherry picked from commit 9a4d980639dd804ad320685a25b8ff4572e3f595)

5 years agoBuild: ESLint: forbid unused function parameters
Michał Gołębiowski-Owczarek [Mon, 13 May 2019 20:25:11 +0000 (22:25 +0200)]
Build: ESLint: forbid unused function parameters

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)

5 years agoBuild: Fix the regex parsing AMD var-modules (#4389)
Michał Gołębiowski-Owczarek [Mon, 13 May 2019 19:55:45 +0000 (21:55 +0200)]
Build: Fix the regex parsing AMD var-modules (#4389)

The previous regex caused the final jQuery binary to have syntax errors for
var-modules with names starting with "return". For example, the following module
wouldn't work when the file is named `returnTrue.js`:

```js
define( function() {
"use strict";
return function returnTrue() {
return true;
};
} );
```

Closes gh-4389

(cherry picked from commit 9ec09c3b4aa5182c2a8b8f51afb861b685a4003c)

5 years agoEffect: Fix a unnecessary conditional statement in .stop()
Wonseop Kim [Wed, 1 May 2019 12:57:55 +0000 (21:57 +0900)]
Effect: Fix a unnecessary conditional statement in .stop()

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)

5 years agoCore: Deprecate jQuery.trim
Shashanka Nataraj [Thu, 22 Aug 2019 00:06:26 +0000 (05:36 +0530)]
Core: Deprecate jQuery.trim

Fixes gh-4363
Closes gh-4461

(cherry picked from 5ea5946094784f68437ef26d463dfcfbbbaff1f6)

5 years agoCore: Use Array.prototype.flat where supported
Ahmed.S.ElAfifi [Mon, 19 Aug 2019 08:04:01 +0000 (10:04 +0200)]
Core: Use Array.prototype.flat where supported

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

5 years agoBuild: Update the version to 3.5.0-pre
Michał Gołębiowski-Owczarek [Tue, 24 Sep 2019 22:44:15 +0000 (00:44 +0200)]
Build: Update the version to 3.5.0-pre

5 years agoCore: Implement .even() & .odd() to replace POS :even & :odd
Michał Gołębiowski-Owczarek [Tue, 24 Sep 2019 00:04:53 +0000 (02:04 +0200)]
Core: Implement .even() & .odd() to replace POS :even & :odd

`: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)

5 years agoTests: Fix offset fractions tests in Chrome for Android
Michał Gołębiowski-Owczarek [Mon, 23 Sep 2019 22:58:53 +0000 (00:58 +0200)]
Tests: Fix offset fractions tests in Chrome for Android

This commit backports a looser assertion from `master` where the browsers passes
offset tests.

Closes gh-4470

5 years agoTests: Move Android user agent detection above iOS, put Safari last
Michał Gołębiowski-Owczarek [Mon, 23 Sep 2019 18:00:24 +0000 (20:00 +0200)]
Tests: Move Android user agent detection above iOS, put Safari last

Android was catching the generic iOS regex. Checking for Android first should
eliminate that issue as iOS user agents don't contain the word "Android".
Putting Safari last makes Android UAs not be tested against it.

5 years agoTests: Make support tests accept Safari 13 & newer
Michał Gołębiowski-Owczarek [Mon, 23 Sep 2019 17:28:43 +0000 (19:28 +0200)]
Tests: Make support tests accept Safari 13 & newer

The regexes detecting browsers with their versions have been updated for iOS
and Safari so that all iOS >=11 & all Safari (desktop) >= 11 are recognized.
This is required to make Safari 13 & iOS 13 pass support tests but it'll also
make tests forward-compatible with future Safari/iOS versions.

Closes gh-4488

5 years agoTests: update npo.js and include unminified source instead
Timmy Willison [Mon, 12 Aug 2019 16:06:52 +0000 (12:06 -0400)]
Tests: update npo.js and include unminified source instead

Close gh-4446
Ref gh-4445

5 years agoSelector: Make selector-native's isXMLDoc recognize HTML-embedded SVG
Michał Gołębiowski-Owczarek [Mon, 29 Jul 2019 20:06:18 +0000 (22:06 +0200)]
Selector: Make selector-native's isXMLDoc recognize HTML-embedded SVG

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

5 years agoTraversing: Fix `contents()` on `<object>`s with children in IE
Michał Gołębiowski-Owczarek [Wed, 8 May 2019 08:12:36 +0000 (10:12 +0200)]
Traversing: Fix `contents()` on `<object>`s with children in IE

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

5 years agoTraversing: Fix `contents()` on `<object>`s with children
Pat O'Callaghan [Mon, 6 May 2019 17:23:00 +0000 (18:23 +0100)]
Traversing: Fix `contents()` on `<object>`s with children

(cherry-picked from 4d865d96aa5aae91823c50020b5c19da79566811)

Fixes gh-4384
Closes gh-4385

5 years agoBuild: Updating the 3.4-stable version to 3.4.2-pre.
Timmy Willison [Wed, 1 May 2019 21:19:45 +0000 (17:19 -0400)]
Build: Updating the 3.4-stable version to 3.4.2-pre.

5 years agoCore: Make isAttached work with iOS 10.0-10.2
Michał Gołębiowski-Owczarek [Mon, 29 Apr 2019 17:54:12 +0000 (19:54 +0200)]
Core: Make isAttached work with iOS 10.0-10.2

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

5 years agoEvent: Prevent leverageNative from registering duplicate dummy handlers
Richard Gibson [Mon, 29 Apr 2019 17:26:53 +0000 (13:26 -0400)]
Event: Prevent leverageNative from registering duplicate dummy handlers

Closes gh-4353

5 years agoEvent: Fix handling of multiple async focus events
Richard Gibson [Mon, 29 Apr 2019 17:18:08 +0000 (13:18 -0400)]
Event: Fix handling of multiple async focus events

Fixes gh-4350
Closes gh-4354

5 years agoBuild: Test on Node.js 12, stop testing on Node.js 6 & 11
Michał Gołębiowski-Owczarek [Tue, 23 Apr 2019 20:44:15 +0000 (22:44 +0200)]
Build: Test on Node.js 12, stop testing on Node.js 6 & 11

(cherry-picked from b8d4712825a26a7f24c2bdb5a71aa3abcd345dfd)

Closes gh-4369

5 years agoBuild: Fix unresolved jQuery reference in finalPropName
Michał Gołębiowski-Owczarek [Wed, 17 Apr 2019 17:56:25 +0000 (19:56 +0200)]
Build: Fix unresolved jQuery reference in finalPropName

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

5 years agoBuild: Updating the 3.4-stable version to 3.4.1-pre
Timmy Willison [Wed, 10 Apr 2019 19:57:28 +0000 (15:57 -0400)]
Build: Updating the 3.4-stable version to 3.4.1-pre

5 years agoRelease: update AUTHORS.txt
Timmy Willison [Tue, 9 Apr 2019 21:49:54 +0000 (17:49 -0400)]
Release: update AUTHORS.txt

5 years agoRelease: update version to 3.4.0-pre
Timmy Willison [Tue, 9 Apr 2019 21:46:05 +0000 (17:46 -0400)]
Release: update version to 3.4.0-pre

5 years agoBuild: Update Sizzle from 2.3.3 to 2.3.4
Michał Gołębiowski-Owczarek [Tue, 9 Apr 2019 07:50:45 +0000 (09:50 +0200)]
Build: Update Sizzle from 2.3.3 to 2.3.4

(cherry-picked from 0b2c36adb4e2c048318659e4196e0925da10ead2)

Fixes gh-1756
Fixes gh-4170
Fixes gh-4249
Closes gh-4345

5 years agoUpdate README.md
Timmy Willison [Tue, 2 Apr 2019 16:31:43 +0000 (12:31 -0400)]
Update README.md

5 years agoTests: Make Android Browser 4.0-4.3 dimensions tests green
Michał Gołębiowski-Owczarek [Wed, 27 Mar 2019 14:47:33 +0000 (15:47 +0100)]
Tests: Make Android Browser 4.0-4.3 dimensions tests green

Android Browser disregards td's box-sizing, treating it like it was content-box.
Unlike in IE, offsetHeight shares the same issue so there's no easy way to
workaround the issue without incurring high size penalty. Let's at least check
we get the size as the browser sees it.

Also, fix the nearby support comment syntax.

Closes gh-4335

5 years agoTests: Make Android Browser 4.0-4.3 AJAX tests green
Michał Gołębiowski-Owczarek [Wed, 27 Mar 2019 14:46:20 +0000 (15:46 +0100)]
Tests: Make Android Browser 4.0-4.3 AJAX tests green

Android Browser versions provided by BrowserStack fail the "prototype collision
(constructor)" test while locally fired emulators don't, even when they connect
to TestSwarm. Just skip the test there to avoid a red build.

Closes gh-4334

5 years agoCore: Preserve CSP nonce on scripts with src attribute in DOM manipulation 4328/head
buddh4 [Tue, 19 Mar 2019 21:40:30 +0000 (22:40 +0100)]
Core: Preserve CSP nonce on scripts with src attribute in DOM manipulation

Fixes gh-4323
Closes gh-4328

5 years agoEvent: Prevent leverageNative from double-firing focusin
Richard Gibson [Mon, 25 Mar 2019 17:12:08 +0000 (13:12 -0400)]
Event: Prevent leverageNative from double-firing focusin

Also, reduce size.

Closes gh-4329
Ref gh-4279

5 years agoCore: Prevent Object.prototype pollution for $.extend( true, ... )
Michał Gołębiowski-Owczarek [Mon, 25 Mar 2019 16:57:30 +0000 (17:57 +0100)]
Core: Prevent Object.prototype pollution for $.extend( true, ... )

Closes gh-4333

5 years agoEvent: Leverage native events for focus/blur/click; propagate additional data
Richard Gibson [Wed, 11 Jan 2017 22:19:30 +0000 (15:19 -0700)]
Event: Leverage native events for focus/blur/click; propagate additional data

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

5 years agoCSS: Avoid forcing a reflow in width/height getters unless necessary
Michał Gołębiowski-Owczarek [Mon, 18 Mar 2019 17:44:43 +0000 (18:44 +0100)]
CSS: Avoid forcing a reflow in width/height getters unless necessary

Fixes gh-4322
Closes gh-4325
Ref gh-3991
Ref gh-4010
Ref gh-4185
Ref gh-4187

5 years agoBuild: Run the basic test suite in jsdom
Michał Gołębiowski-Owczarek [Mon, 11 Mar 2019 19:03:54 +0000 (20:03 +0100)]
Build: Run the basic test suite in jsdom

The basic test suite is now run in jsdom on all supported Node.js versions
(8, 10 & 11 as of now).

Closes gh-4310

5 years agoBuild: Remove manual QUnit fixture resetting
Michał Gołębiowski-Owczarek [Mon, 11 Mar 2019 16:25:48 +0000 (17:25 +0100)]
Build: Remove manual QUnit fixture resetting

It was needed when QUnit 1.x one used but we've since upgraded to QUnit 2.x.

Closes gh-4312
Ref gh-4307

5 years agoBuild: Make Promises/A+ tests use the dot reporter instead of the default
Michał Gołębiowski-Owczarek [Mon, 11 Mar 2019 15:06:17 +0000 (16:06 +0100)]
Build: Make Promises/A+ tests use the dot reporter instead of the default

The default reporter is very verbose as it prints all the test names it
encounters. We already use the dot reporter for Karma tests.

Closes gh-4313

5 years agoBuild: Update QUnit from 1.23.1 to 2.9.2 4314/head
Michał Gołębiowski-Owczarek [Mon, 4 Mar 2019 19:10:21 +0000 (20:10 +0100)]
Build: Update QUnit from 1.23.1 to 2.9.2

Closes gh-4307

5 years agoBuild: Run Karma browser tests on Node.js 10 instead of 8
Michał Gołębiowski-Owczarek [Mon, 4 Mar 2019 18:05:09 +0000 (19:05 +0100)]
Build: Run Karma browser tests on Node.js 10 instead of 8

Node.js 10 has been in Active LTS since 2018-04-24 and Node.js 8 is now in
maintenance mode.

See https://github.com/nodejs/Release for more details.

Closes gh-4311

5 years agoBuild: Update jsdom; migrate a test with Symbol polyfill to an iframe test
Michał Gołębiowski-Owczarek [Mon, 4 Mar 2019 17:30:51 +0000 (18:30 +0100)]
Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test

So far, we've been testing that jQuery element iteration works with polyfilled
Symbol & transpiled for-of via a Node test with jsdom with the Symbol global
removed. Unfortunately, jsdom now requires Symbol to be present for its internal
functionality so such a test is no longer possible. Instead, it's been migrated
to an iframe test with transpiled JavaScript.

This PR also enables us to use ECMAScript 2017 or newer in Node.js code.

Closes gh-4305

5 years agoBuild: Remove obsolete globals from ESLint configuration
Michał Gołębiowski-Owczarek [Tue, 19 Feb 2019 12:20:57 +0000 (13:20 +0100)]
Build: Remove obsolete globals from ESLint configuration

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

5 years agoBuild: Update most dependencies
abnud1 [Sun, 11 Nov 2018 04:52:13 +0000 (06:52 +0200)]
Build: Update most dependencies

The only packages not fully updated are:
- qunitjs & karma-qunit as that's a QUnit 2.x update that will require some
changes and we'll do that later
- jsdom as we need to first rewrite the test with the Symbol polyfill - newer
jsdom versions don't work with such a hacked Symbol instance
- sinon as the v2 -> v7 upgrade requires to update our unit tests
- uglify-js & grunt-contrib-uglify as latest uglify-js versions slightly worsen
the minified gzipped size

Closes gh-4227
Closes gh-4228
Closes gh-4230
Closes gh-4232

5 years agoBuild: Update test code for compatibility with QUnit 2.x (#4297)
abnud1 [Mon, 18 Feb 2019 18:02:38 +0000 (19:02 +0100)]
Build: Update test code for compatibility with QUnit 2.x (#4297)

Also, run `grunt npmcopy` to sync the "external" directory with dependencies
from package.json. For example, the Sinon library version didn't match.

Ref gh-4234
Closes gh-4297

5 years agoBuild: Advise to create test cases on JS Bin or CodePen, drop JSFiddle
Michał Gołębiowski-Owczarek [Tue, 29 Jan 2019 13:13:53 +0000 (14:13 +0100)]
Build: Advise to create test cases on JS Bin or CodePen, drop JSFiddle

JSFiddle doesn't support IE (even 11) anymore so we shouldn't advise users
to use it to create test cases. To make people have a choice, add CodePen
to the list.

Also, link to specific starter templates so that novices don't need to spend
time thinking how to set up the basic structure.

Closes gh-4289

5 years agoCore: Support passing nonce through jQuery.globalEval
Michał Gołębiowski-Owczarek [Mon, 21 Jan 2019 17:42:39 +0000 (18:42 +0100)]
Core: Support passing nonce through jQuery.globalEval

Fixes gh-4278
Closes gh-4280
Ref gh-3541
Ref gh-4269

5 years agoManipulation: Respect script nomodule attribute in DOM manipulation
Michał Gołębiowski-Owczarek [Mon, 21 Jan 2019 17:34:40 +0000 (18:34 +0100)]
Manipulation: Respect script nomodule attribute in DOM manipulation

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

5 years agoTests: Skip nonce tests in old iOS/Android as well
Michał Gołębiowski-Owczarek [Mon, 14 Jan 2019 18:49:28 +0000 (19:49 +0100)]
Tests: Skip nonce tests in old iOS/Android as well

Old iOS & Android Browser versions support script-src but not nonce, making the
nonce test impossible to run. Browsers not supporting CSP at all are not
a problem as they'll skip script-src restrictions completely.

Ref gh-3541
Ref gh-4269
Ref c7c2855ed13f23322c4064407c1ed84561b95738