| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces a new test API, `includesModule`. The method returns whether
a particular module like "ajax" or "deprecated" is included in the current
jQuery build; it handles the slim build as well. The util was created so that
we don't treat presence of particular APIs to decide whether to run a test as
then if we accidentally remove an API, the tests would still not fail.
Closes gh-5071
Fixes gh-5069
Ref gh-5046
(partially cherry picked from commit fae5fee8b435cc20352d28b0a384b9784b1ad9ed)
|
|
|
|
|
|
|
|
| |
See https://bugzilla.mozilla.org/show_bug.cgi?id=1751796
Closes gh-5018
(cherry picked from commit af1cd6f218f699abc34b1582a910c0df00312aee)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes jQuery skip falsy values in `addClass( array )`
& `removeClass( array )` instead of stopping iteration when the first falsy
value is detected. This makes code like:
```js
elem.addClass( [ "a", "", "b" ] );
```
add both the `a` & `b` classes.
The code was also optimized for size a bit so it doesn't increase the
minified gzipped size.
Fixes gh-4998
Closes gh-5003
(partially cherry picked from commit a338b407f2479f82df40635055effc163835183f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a version of gh-4993 for the `3.x-stable` branch.
The GitHub UI treats `#NUMBER` as referring to its own issues which is confusing
when in jQuery source it's usually referring to the old deprecated Trac instance
at https://bugs.jquery.com. This change replaces all such Trac references with
`trac-NUMBER`.
A few of the references came with the Sizzle integration and referred to the
Sizzle GitHub bug tracker. Those have been replaced with full links instead.
A new entry describing issue reference conventions has been added to README.
Closes gh-4994
Ref gh-4993
Ref 5d5ea015114092c157311c4948f7cc3d8c8e7f8a
|
|
|
|
|
| |
Ref gh-4981
Ref gh-4991
|
|
|
|
|
|
|
|
|
|
| |
TestSwarm is now proxied via Cloudflare which cuts out headers relevant for
ETag tests, failing them. We're still running those tests in Karma on Chrome
& Firefox (including Firefox ESR).
Closes gh-4974
(cherry picked from commit 00c060d1619d472a2d8c5b104ed76fa3afc2ce97)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In HTTP/2, status message is not supported and whatever is reported as
statusText differs between browsers. In Chrome & Safari it's "success", in
Firefox & IE it's "OK". So far "success" wasn't allowed. This made the tests
pass locally if you're running an HTTP/1.1 server but on TestSwarm which is
now proxied via an HTTP/2-equipped Cloudflare, the relevant test started failing
in Chrome & Safari.
Allow "success" to resolve the issue.
Closes gh-4973
(cherry picked from commit 19ced963c63372eae5aca9e1a4baec80b78a2b8e)
|
|
|
|
|
|
|
|
| |
Safari 9.1 & iOS 9.3 support CSS custom properties but that support
is buggy which crashes our tests. Disable those tests there.
See https://caniuse.com/css-variables
Closes gh-4966
|
|
|
|
|
|
|
|
|
|
|
| |
The spec has recently changed and CSS Custom Properties values are trimmed now.
This change makes jQuery polyfill that new behavior for all browsers.
Ref w3c/csswg-drafts#774
Fixes gh-4926
Closes gh-4930
(partially cherry picked from commit efadfe991a5c287af561a9326bf1427d726c91c1)
|
|
|
|
|
|
|
|
|
| |
For some reason the current setup worked fine with Apache but broke for me when
I migrated to nginx.
Closes gh-4936
(cherry picked from commit 1019074f7b1df96ee9d6409ada3dc0562046f6c7)
|
|
|
|
| |
(cherry picked from commit d225639a8ea62863482bd20249077688f60235db)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When evaluating scripts, jQuery strips out the possible wrapping HTML comment
and a CDATA section. However, all supported browsers are already doing that
when loading JS via appending a script tag to the DOM which is how we've been
doing `jQuery.globalEval` since jQuery 3.0.0. jQuery logic was imperfect, e.g.
it just stripped the `<!--` and `-->` markers, respectively at the beginning or
the end of the script contents. However, browsers are also stripping everything
following those markers in the same line, treating them as single-line comments
delimiters; this is now also mandated by ECMAScript 2015 in Annex B. Instead
of fixing the jQuery logic, just let the browser do its thing.
We still need to strip CDATA sections for backwards compatibility. This
shouldn't be needed as in XML documents they're already not visible when
inspecting element contents and in HTML documents they have no meaning but
we're preserving that logic for backwards compatibility. This will be removed
completely in 4.0.
Fixes gh-4904
Closes gh-4905
Ref gh-4906
|
|
|
|
|
|
|
|
| |
Also, remove unused `expected` property in `css` test cases.
Closes gh-4866
(cherry picked from commit 482f846203e82b1c2620f580e483bf41d11f9f49)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `_default` function in the special event settings for focus/blur has
always returned `true` since gh-4813 as the event was already being fired
from `leverageNative`. However, that only works if there's an active handler
on that element; this made a quick consecutive call:
```js
elem.on( "focus", function() {} ).off( "focus" );
```
make subsequent `.trigger( "focus" )` calls to not do any triggering.
The solution, already used in a similar `_default` method for the `click` event,
is to check for the `dataPriv` entry on the element for the focus event
(similarly for blur).
Fixes gh-4867
Closes gh-4885
(cherry picked from commit e539bac79e666bba95bba86d690b4e609dca2286)
|
|
|
|
|
|
|
|
|
|
| |
All the other files were already taken from the external directory.
The fact core-js was taken from node_modules broke IE core tests on TestSwarm.
Ref gh-4865
Ref gh-4870
(partially cherry picked from 345cd22e5664655ed315958ed2056610607c12ef)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only allow alphanumeric characters & underscores for callback parameters.
The change is done both for the PHP server as well as the Node.js-based version.
This is only test code so we're not fixing any security issue but it happens
often enough that the whole jQuery repository directory structure is deployed
onto the server with PHP enabled that it makes is easy to introduce security
issues if this cleanup is not done.
Ref gh-4764
Closes gh-4871
(cherry picked from a70274632dc19ff4a64d7bb7657a2cc647ff38b9)
|
|
|
|
|
|
|
|
|
| |
The default branch was updated, this updates the remaining occurrences in code
& comments.
Closes gh-4838
(cherry picked from commit 8ae477a432f0924cd4bd3bdeaef2c4c15e483a8f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two issues are fixed in testing for responses with a script Content-Type not
getting auto-executed unless an explicit `dataType: "script"` is provided:
* the test is now using a correct "text/javascript" Content-Type; it was using
"text/html" until now which doesn't really check if the fix works
* the Node.js based version of the tests didn't account for an empty `header`
query string parameter
Closes gh-4824
Ref gh-2432
Ref gh-2588
Ref 39cdb8c9aa0fde68f733553ba050a2ba9d86474c
(cherry picked from commit d38528b17a846b7ca4513b41150a05436546292d)
|
|
|
|
|
|
|
|
|
| |
Firefox incorrectly (or perhaps correctly) includes table borders in computed
dimensions, but they are the only one. Workaround this by testing for it and
falling back to offset properties
Fixes gh-4529
Closes gh-4807
|
|
|
|
|
|
|
|
| |
Legacy Edge, similarly to IE, doesn't report XML parsing errors but just tries
to render the invalid document. Skip the error reporting test there, Edge Legacy
will return a generic "Invalid XML" error, just like IE.
Ref gh-4816
|
|
|
|
|
|
|
|
| |
Changes:
* Remove incorrect `QUnit.testUnlessIE` usage as that util is only available
on `master`, not here.
* Change `firstCall.lastArg` to `firstCall.args[ 0 ]` as the former API is not
available in older Sinon versions.
|
|
|
|
|
|
|
| |
Fixes gh-4784
Closes gh-4816
(cherry picked from commit 8969732518470a7f8e654d5bc5be0b0076cb0b87)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If during a focus handler another focus event is triggered:
```js
elem1.on( "focus", function() {
elem2.trigger( "focus" );
} );
```
due to their synchronous nature everywhere outside of IE the hack added in
gh-4279 to leverage native events causes the native `.focus()` method to be
called last for the initial element, making it steal the focus back. Since
the native method is already being called in `leverageNative`, we can skip that
final call.
This aligns with changes to the `_default` method for the `click` event that
were added when `leverageNative` was introduced there.
A side effect of this change is that now `focusin` will only propagate to the
document for the last focused element. This is a change in behavior but it also
aligns us better with how this works with native methods.
Fixes gh-4382
Closes gh-4813
Ref gh-4279
(cherry picked from commit dbcffb396c2db61ff96edc4162602e850797d61f)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Chrome, if an element having a `focusout` handler is blurred by
clicking outside of it, it invokes the handler synchronously. If
that handler calls `.remove()` on the element, the data is cleared,
leaving private data undefined. We're reading a property from that
data so we need to guard against this.
Fixes gh-4417
Closes gh-4799
(cherry picked from commit 5c2d08704e289dd2745bcb0557b35a9c0e6af4a4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This aligns the Node.js server with the previous PHP one in sending `mock.php`
as a callback if there's no `callback` parameter in the query string which is
triggered by a recently added test. This prevents the request crashing on that
Node.js server and printing a JS error:
```
TypeError: Cannot read property '1' of null
```
Closes gh-4764
Ref gh-4754
(cherry picked from commit df6858df2ed3fc5c424591a5e09b900eb4ce0417)
|
|
|
|
|
|
|
|
|
|
|
| |
The test has been already skipped in Chrome as it dropped support for such
requests and now Safari has joined the squad.
This will resolve AJAX test errors we've had for a while in Safari 13 & iOS 13.
Closes gh-4779
(cherry picked from commit c18dc49699bc27481a4af36ed1a0ee1b19c6eb03)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue gh-4379 was meant to be a bug fix but the JSONP case is a bit special:
under the hood it's a script but it simulates JSON responses in an environment
without a CORS setup and sending JSON payloads on error responses is quite
typical there.
This commit makes JSONP error responses still execute the payload. The regular
script error responses continue to be skipped.
Fixes gh-4771
Closes gh-4773
(cherry picked from commit a1e619b03a557b47c3e26a5e74af12b63a0d5e73)
|
|
|
|
|
|
| |
Closes gh-4769
(cherry picked from commit 82b87f6f0e45ca4e717b4e3a4a20a592709a099f)
|
|
|
|
|
|
|
|
|
| |
PR gh-4586 removed some of those but not all.
Closes gh-4715
Ref gh-4586
(cherry picked from commit d96111e18b42ae1bc7def72a8a0d156ea39e4d0e)
|
|
|
|
|
|
|
|
| |
The tests relied on `jQuery.cache` so they only ever worked in jQuery 1.x.
Closes gh-4586
(cherry picked from commit eb35be528fdea40faab4d89ac859d38dfd024271)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
Closes gh-4686
(cherry picked from commit 1a7332ce83cdee7d6cd9d45c2a4b83067f53f14b)
|
|
|
|
|
|
|
|
| |
Closes gh-4685
Ref gh-4642
Ref gh-4647
(cherry picked from commit dc06d68bdc4c2562b5cc530f21e668a17d78ee2d)
|
|
|
|
|
|
|
| |
The "focusin on document & window" test didn't cleanup `focusout` handlers
on `window` & `document`. This has been fixed.
Ref gh-4657
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
Closes gh-4647
|
|
|
|
|
|
| |
Closes gh-4642
(cherry picked from 90fed4b453a5becdb7f173d9e3c1492390a1441f)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|