Commit Graph

6534 Commits

Author SHA1 Message Date
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
Michał Gołębiowski-Owczarek
0c67da4b74
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
2019-09-24 00:58:53 +02:00
Michał Gołębiowski-Owczarek
6276cb2e23 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.
2019-09-24 00:46:21 +02:00
Michał Gołębiowski-Owczarek
8167327fd9
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
2019-09-23 19:28:43 +02:00
Timmy Willison
3654bc831d
Tests: update npo.js and include unminified source instead
Close gh-4446
Ref gh-4445
2019-08-12 12:14:58 -04:00
Michał Gołębiowski-Owczarek
2d9d6d5b47
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 79b74e043a)

Closes gh-4438
Ref jquery/sizzle#378
Ref jquery/sizzle#436
2019-07-29 22:06:18 +02:00
Michał Gołębiowski-Owczarek
90f78b9aab 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 ccbd6b9342)

Closes gh-4390
Ref gh-4384
Ref gh-4385
2019-05-08 11:08:14 +02:00
Pat O'Callaghan
42badf3460 Traversing: Fix contents() on <object>s with children
(cherry-picked from 4d865d96aa)

Fixes gh-4384
Closes gh-4385
2019-05-06 21:07:53 +02:00
Timmy Willison
0e3e23df22
Build: Updating the 3.4-stable version to 3.4.2-pre. 2019-05-01 17:19:45 -04:00
Michał Gołębiowski-Owczarek
7dddb19ca4
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
2019-04-29 19:54:12 +02:00
Richard Gibson
6c1e7dbf73 Event: Prevent leverageNative from registering duplicate dummy handlers
Closes gh-4353
2019-04-29 19:26:53 +02:00
Richard Gibson
24d71ac704 Event: Fix handling of multiple async focus events
Fixes gh-4350
Closes gh-4354
2019-04-29 19:18:08 +02:00
Michał Gołębiowski-Owczarek
b4fadc9b54 Build: Test on Node.js 12, stop testing on Node.js 6 & 11
(cherry-picked from b8d4712825)

Closes gh-4369
2019-04-23 23:12:29 +02:00
Michał Gołębiowski-Owczarek
0d4af52934 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 874030583c)

Fixes gh-4358
Closes gh-4361
2019-04-17 19:58:20 +02:00