Commit Graph

6647 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
205dd134b9 Build: Test on Node.js 14, stop testing on Node.js 8 & 13
Closes gh-4678

(cherry picked from commit 88eb22e059)
2020-04-23 14:15:19 +02:00
Ed S
b21d6710cf Build: Enable reportUnusedDisableDirectives in ESLint
This forbids unnecessary `eslint-disable` comments.

Ref gh-4095
Closes gh-4520

(cherry picked from 46f9810b73)
2020-04-20 19:06:13 +02:00
Michał Gołębiowski-Owczarek
65e909844c
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
2020-04-20 18:11:18 +02:00
Jonathan
763dd3fefa Docs: Use https for hyperlinks in README
Closes gh-4673

(cherry picked from commit 73415da25d)
2020-04-17 11:48:38 +02:00
Michał Gołębiowski-Owczarek
898784ab84 Build: Updating the 3.x-stable version to 3.5.1-pre. 2020-04-10 17:47:07 +02:00
Michał Gołębiowski-Owczarek
8570a08f66 Release: Update AUTHORS.txt 2020-04-10 16:45:30 +02:00
Sean Robinson
da3dd85b63 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 50871a5a85)

Fixes gh-4250
Fixes gh-4655
Closes gh-4379
2020-04-06 22:33:56 +02:00
Christian Wenz
065143c2e9 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 7fb90a6bea)

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
2020-04-06 21:19:25 +02:00
Michał Gołębiowski-Owczarek
1a4f10ddc3 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.
2020-04-06 20:56:02 +02:00
Michał Gołębiowski-Owczarek
9e15d6b469
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 1cecf64e5a - the commit that
introduced the regression - to make sure we don't regress on either front.

Fixes gh-4652
Closes gh-4656
2020-04-06 20:34:40 +02:00
Michał Gołębiowski-Owczarek
966a709090
Manipulation: Skip the select wrapper for <option> outside of IE 9
Closes gh-4647
2020-03-30 20:15:09 +02:00
Michał Gołębiowski-Owczarek
1d61fd9407 Manipulation: Make jQuery.htmlPrefilter an identity function
Closes gh-4642

(cherry picked from 90fed4b453)
2020-03-16 21:59:49 +01:00
Michał Gołębiowski-Owczarek
04bf577e2f
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
2020-03-16 17:34:27 +01:00
Michał Gołębiowski-Owczarek
7506c9ca62 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 5b94a4f847)
2020-03-13 17:19:02 +01:00
Michał Gołębiowski-Owczarek
413ff796ae 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 9d76c0b163)
2020-03-02 23:05:58 +01:00
Michał Gołębiowski-Owczarek
524bcf39da 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 358b769a00)
2020-03-02 22:48:29 +01:00
Michał Gołębiowski-Owczarek
0fdfdd8290 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 4a7fc8544e)
2020-03-02 22:30:00 +01:00
Michał Gołębiowski-Owczarek
5ea844f65a 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 364476c3dc)
2020-03-02 22:18:10 +01:00
Michał Gołębiowski-Owczarek
362075aeaa
Build: Test the no-Sizzle build on Travis
Closes gh-4635
2020-03-02 20:43:11 +01:00
Michał Gołębiowski-Owczarek
19f2dcbaa3 Build: Update .mailmap & AUTHORS.txt
Partially based on gh-4613.

Ref gh-4613
Ref 721744a9fa
2020-02-24 22:25:43 +01:00
Michał Gołębiowski-Owczarek
22bf701fe1
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 d0ce00cdfa
2020-02-24 19:10:03 +01:00
Michał Gołębiowski-Owczarek
3dedc3f2d4 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 4592595b47)
2020-02-10 19:20:50 +01:00
Michał Gołębiowski-Owczarek
d525ae3416
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
2020-01-27 18:54:47 +01:00
Michał Gołębiowski-Owczarek
7a3cf9c03c 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 23d53928f3)
2020-01-21 14:26:35 +01:00
Michał Gołębiowski-Owczarek
37df5cdf4e 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
2020-01-21 14:06:42 +01:00
Michał Gołębiowski-Owczarek
46c284b12b
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 341c6d1b5a)
(partially cherry picked from 437f389a24)

Closes gh-4595
Ref gh-4550
Ref gh-4574
2020-01-21 13:26:47 +01:00
Michał Gołębiowski-Owczarek
d72faced11 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 1dad1185e0)

Closes gh-4584
2020-01-08 01:30:30 +01:00
Michał Gołębiowski-Owczarek
f0d5ec62c3
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
2020-01-07 17:05:14 +01:00
Michał Gołębiowski-Owczarek
4cbdc745cc Build: Create a grunt custom:slim alias for the Slim build
Closes gh-4578

(cherry-picked from 9b9ed469b4)
2020-01-07 16:45:22 +01:00
Michał Gołębiowski-Owczarek
f36f6abbb3 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 d5c505e35d)

Fixes gh-4397
Closes gh-4558
2019-12-09 19:53:17 +01:00
Michał Gołębiowski-Owczarek
c79e1d5fef
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
2019-10-28 20:38:33 +01:00
Michał Gołębiowski-Owczarek
c5b48c8caa
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
2019-10-28 20:27:49 +01:00
Michał Gołębiowski-Owczarek
471b004326 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 bcbcdd2b2c)
2019-10-22 20:50:26 +02:00
Michał Gołębiowski-Owczarek
0a73b94a21
Build: Run tests on Firefox ESR as well
Closes gh-4530
2019-10-22 20:20:53 +02:00
Michał Gołębiowski-Owczarek
64c1fcc1cd Build: Run tests on Node.js 13 in addition to 8, 10 & 12
Closes gh-4528

(cherry picked from commit 830976e690)
2019-10-22 20:09:45 +02:00
Michał Gołębiowski-Owczarek
9f4204ecad Build: Drop workarounds for Node.js 6 in Gruntfile.js 2019-10-22 20:09:15 +02:00
Michał Gołębiowski-Owczarek
ad3c2efa10 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)
2019-10-22 20:07:56 +02:00
Dave Methvin
57038faebc 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
2019-10-21 18:53:24 +02:00
Michał Gołębiowski-Owczarek
6d31477a35
CSS: Workaround buggy getComputedStyle on table rows in IE/Edge
Fixes gh-4490
Closes gh-4503
2019-10-14 18:34:06 +02:00
Michał Gołębiowski-Owczarek
ac2da4e6b9 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 bbad821c39)
2019-10-09 00:24:17 +02:00
Christian Oliff
ff5a43eb93 Docs: Convert link to Homebrew from HTTP to HTTPS
`http://brew.sh/` -> `https://brew.sh/`

Closes gh-4501

(cherry picked from commit e0022f2314)
2019-10-07 08:54:28 +02:00
Michał Gołębiowski-Owczarek
c7a5e1bd79 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 d7d0b52bda)
2019-10-05 18:50:18 +02:00
Michał Gołębiowski-Owczarek
279d2e979e 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 9a4d980639)
2019-10-04 16:13:58 +02:00
Michał Gołębiowski-Owczarek
d7e13f128a 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 438b1a3e8a)
2019-09-26 01:59:57 +02:00
Michał Gołębiowski-Owczarek
36b59c9661 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 9ec09c3b4a)
2019-09-26 01:18:22 +02:00
Wonseop Kim
30f5c6c3ee 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 110802c7f2)
2019-09-26 01:14:38 +02:00
Shashanka Nataraj
56e73e0c4a Core: Deprecate jQuery.trim
Fixes gh-4363
Closes gh-4461

(cherry picked from 5ea5946094)
2019-09-26 01:00:55 +02:00
Ahmed.S.ElAfifi
2f666c1dab 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 9df4f1de12)

Fixes gh-4320
Closes gh-4459
2019-09-25 17:49:32 +02:00
Michał Gołębiowski-Owczarek
78ff24dd4b Build: Update the version to 3.5.0-pre 2019-09-25 00:44:15 +02:00
Michał Gołębiowski-Owczarek
409cbda7fe 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 78420d427c)
2019-09-24 02:05:39 +02:00