Commit Graph

6556 Commits

Author SHA1 Message Date
Richard Gibson
a1373e2e4f CSS: Justify use of rtrim on CSS property values
CSS does not acknowledge carriage return or form feed characters
as whitespace but it does replace them with whitespace, making it
acceptable to use `rtrim`.

Closes gh-4956

(cherry picked from commit 655c0ed5e2)
2022-01-03 14:07:49 +01:00
Timmy Willison
5566988359
Build: remove travis.yml and travis mentions from core (#4984)
We've migrate jquery core to GH actions and have already disabled core builds on travis
2021-12-13 12:22:34 -05:00
Michał Gołębiowski-Owczarek
81fa1e2ae9 Tests: Skip ETag AJAX tests on TestSwarm
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 00c060d161)
2021-12-01 13:25:52 +01:00
Michał Gołębiowski-Owczarek
7439e221c0 Tests: Allow statusText to be "success" in AJAX tests
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 19ced963c6)
2021-12-01 13:25:43 +01:00
ygj6
b39cfa1505 Build: Migrate CI to GitHub Actions
Closes gh-4800

(cherry picked from commit e23190e63c)
2021-12-01 00:03:59 +01:00
Michał Gołębiowski-Owczarek
4bb7d069ca Docs: Update the URL to the latest jQuery build in CONTRIBUTING.md
It used to say https://code.jquery.com/jquery.js but that's a frozen URL
to jQuery 1.11.1. Let's switch that to the URL to the Git build, i.e.
https://releases.jquery.com/git/jquery-git.js.

Closes gh-4972

(cherry picked from commit 9bdb16cd19)
2021-11-18 22:56:32 +01:00
Michał Gołębiowski-Owczarek
e9f77267d0
Tests: Disable CSS Custom Properties tests in old Safari/iOS
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
2021-11-15 18:40:58 +01:00
Michał Gołębiowski-Owczarek
a51eec7484 Tests: Make Karma browser timeout larger than the QUnit one
Since the default Karma browser no activity timeout was lower than the QUnit
timeout, a single timing out test was interrupting the whole test run of
a browser.

The QUnit timeout is set to 1 minute so I set the Karma one to 2 minutes.

Closes gh-4943

(cherry picked from commit 4fd6912bfd)
2021-10-30 00:57:20 +02:00
Michał Gołębiowski-Owczarek
509eeb892c CSS: Remove a redundant extension from rtrimCSS inclusion in curCSS
This breaks the AMD mode.
2021-10-19 00:31:49 +02:00
fecore1
219ccf5c5f CSS: Trim whitespace surrounding CSS Custom Properties values
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 efadfe991a)
2021-10-18 22:43:59 +02:00
Michał Gołębiowski-Owczarek
934064905c Docs: Remove the CLA checkbox in the pull request template
The EasyCLA status check is required so this won't get missed. The old JSF CLA
is dead, the provided link doesn't return meaningful information. There's no
good replacement link for the old CLA; PR authors are just supposed to sign the
new CLA by clicking on a link posted by the EasyCLA bot when they submit their
first PR since EasyCLA was enabled for the repo.

Closes gh-4937

(cherry picked from commit e124893132)
2021-10-18 18:09:37 +02:00
Michał Gołębiowski-Owczarek
ba81326ffd Tests: Don't remove csp.log in the cspClean action of mock.php
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 1019074f7b)
2021-09-30 00:31:27 +02:00
Michał Gołębiowski-Owczarek
f6f0720472 Tests: Load the TestSwarm listener via HTTPS
(cherry picked from commit d225639a8e)
2021-09-29 17:19:37 +02:00
Michał Gołębiowski-Owczarek
924b515dd3
Manipulation: Don't remove HTML comments from scripts
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
2021-07-19 19:15:27 +02:00
Michał Gołębiowski-Owczarek
f12cac6075 Build: Test on Node.js 16 instead of 15
Node.js 10 is kept for now despite being EOL'd as that's what our current
infrastructure relies on.

Closes gh-4902

(cherry picked from commit 0f623fdc8d)
2021-07-12 18:36:25 +02:00
Timo Tijhof
8d20cb9732 Tests: Switch background image from online file to local 1x1.jpg
Also, remove unused `expected` property in `css` test cases.

Closes gh-4866

(cherry picked from commit 482f846203)
2021-05-24 18:30:54 +02:00
Michał Gołębiowski-Owczarek
b3e4a7eb16 Event: Don't break focus triggering after .on(focus).off(focus)
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 e539bac79e)
2021-05-10 19:13:25 +02:00
Michał Gołębiowski-Owczarek
752b8981f8 Build: Take core-js from the external directory as well
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 345cd22e56)
2021-04-14 01:47:38 +02:00
Michał Gołębiowski-Owczarek
b14b62c8a2 Tests: Strip untypical callback parameter characters from mock.php
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 a70274632d)
2021-04-13 22:36:19 +02:00
Timmy Willison
3642471ec5
Build: Updating the 3.x-stable version to 3.6.1-pre. 2021-03-02 12:12:18 -05:00
Timmy Willison
aed59da0c9
Release: remove the need to install grunt globally 2021-03-01 17:48:55 -05:00
Timmy Willison
8606ce4292
Release: update version to 3.6.0-pre 2021-03-01 17:44:10 -05:00
Timmy Willison
8b50fbe75d
Release: drop the need for npm as a local dependency
- Not meant to be used like that anymore
2021-03-01 17:41:18 -05:00
Timmy Willison
a21a4b2de7
Release: upgrade release dependencies 2021-03-01 16:48:41 -05:00
Timmy Willison
c208debdec
Release: update AUTHORS.txt 2021-03-01 14:40:03 -05:00
Michał Gołębiowski-Owczarek
165487406f
Selector: Update Sizzle from 2.3.5 to 2.3.6
Fixes gh-4782
Close gh-4846
2021-02-17 16:19:56 -05:00
Timmy Willison
f8bdb1270a
Support: ensure display is set to block for the support div (#4844)
- Fixes an issue with the support test in iframes in Android 8 Chrome 86+,
  where display: inline resulted in unexpected height values.

Fixes gh-4832
2021-02-16 14:34:14 -05:00
Michał Gołębiowski-Owczarek
627c573ac6 Build: Rename master to main across the repository
The default branch was updated, this updates the remaining occurrences in code
& comments.

Closes gh-4838

(cherry picked from commit 8ae477a432)
2021-02-05 23:21:21 +01:00
Michał Gołębiowski-Owczarek
15b62a2eb5 Deferred: Rename master to primary
Closes gh-4828

(cherry picked from a32cf6324f)
2021-01-12 21:04:59 +01:00
Michał Gołębiowski-Owczarek
7298e04fae Tests: Fix tests for not auto-executing scripts without dataType
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 39cdb8c9aa

(cherry picked from commit d38528b17a)
2021-01-11 18:41:36 +01:00
Timmy Willison
bcd40aa7a3
Dimensions: Modify reliableTrDimensions support test to account for FF
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
2021-01-11 11:56:38 -05:00
Michał Gołębiowski-Owczarek
bf06dd477a Tests: Skip the jQuery.parseXML error reporting test in Legacy Edge
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
2020-12-08 14:27:05 +01:00
Michał Gołębiowski-Owczarek
1ec36332fc Tests: Fix the jQuery.parseXML error reporting test
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.
2020-12-08 12:05:41 +01:00
Michał Gołębiowski-Owczarek
54d98835b6 Core: Report browser errors in parseXML
Fixes gh-4784
Closes gh-4816

(cherry picked from commit 8969732518)
2020-12-08 11:34:50 +01:00
Michał Gołębiowski-Owczarek
2fadbc0a98 Event: Make focus re-triggering not focus the original element back
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 dbcffb396c)
2020-12-07 21:06:44 +01:00
Michał Gołębiowski-Owczarek
07829a1664
Build: Fix Travis build on Node.js 15 with npm 7
The `grunt-karma` version we used required Karma 3.x and it's now enforced
in npm 7. Update a few Karma & Grunt-related packages to resolve the issue.

Closes gh-4810
2020-11-17 17:05:41 +01:00
Michał Gołębiowski-Owczarek
0458f98eec Build: Test on Node.js 15
Also, run browser tests on Node 14 instead of 12.

Closes gh-4802

(cherry-picked from 6984d17476)
2020-11-11 23:04:31 +01:00
Michał Gołębiowski-Owczarek
aaf9c55ad2 Event: Don't crash if an element is removed on blur
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 5c2d08704e)
2020-10-19 21:21:54 +02:00
Michał Gołębiowski-Owczarek
4c572a7fee Tests: Recognize callbacks with dots in the Node.js mock server
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 df6858df2e)
2020-09-02 18:46:56 +02:00
Michał Gołębiowski-Owczarek
4f016c642c Tests: Skip the "jQuery.ajax() on unload" test in Safari
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 c18dc49699)
2020-09-02 18:05:47 +02:00
Michał Gołębiowski-Owczarek
2bf9793efc Event: Remove the event.which shim
All supported browsers implement this property by themselves. The shim was only
needed for IE <9.

Fixes gh-3235
Closes gh-4765
Ref gh-4755

(cherry picked from commit 1a5fff4c16)
2020-08-26 14:19:24 +02:00
Dallas Fraser
3bae54aa50 Ajax: Execute JSONP error script responses
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 a1e619b03a)
2020-08-25 21:43:02 +02:00
Wonhyoung Park
beea433d33 Tests: Remove an unused local variable
Closes gh-4769

(cherry picked from commit 82b87f6f0e)
2020-08-13 13:28:32 +02:00
Natalia Sroka
bf1430a7e6
Core: Bring back QtWebKit support for jQuery 3.x
Allow jQuery to recognize that DOM types such as HTMLCollection
or NodeList are not functions.

Fixes gh-4756
Closes gh-4757
2020-07-27 22:01:55 +02:00
Michał Gołębiowski-Owczarek
fe4098005e
Revert "Offset: Send px-ed strings to .css()"
The way warning against number values in `.css()` setters was done in
jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348
there's no need to send px-ed strings for `top` & `left` as they already
don't get the "px" suffix.

This reverts commit 57038faebc.

Closes gh-4753
Ref jquery/jquery-migrate/pull/337
Ref jquery/jquery-migrate/pull/348
2020-07-20 21:29:40 +02:00
Beatriz Rezener
d32a7a524f Build: Fix commitplease husky config
Fixes gh-4735
Closes gh-4737

(cherry picked from commit 3a1b338a7a)
2020-07-20 19:12:28 +02:00
Michał Gołębiowski-Owczarek
25407dcaf5 Build: Update eslint-config-jquery, fix linting violations
Closes gh-4696
Ref jquery/eslint-config-jquery#15
Ref jquery/eslint-config-jquery#16

(cherry picked from commit ef4d6ca6c3)
2020-05-18 22:40:42 +02:00
Michał Gołębiowski-Owczarek
5e028c76f4 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 d96111e18b)
2020-05-18 18:53:26 +02:00
Michał Gołębiowski-Owczarek
8ad78cdbc4 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 eb35be528f)
2020-05-18 18:51:34 +02:00
Michał Gołębiowski-Owczarek
db43ef0bff Docs: Change JS Foundation mentions to OpenJS Foundation
Closes gh-4711

(cherry picked from 11611967ad)
2020-05-18 18:46:27 +02:00