]> source.dussan.org Git - jquery.git/log
jquery.git
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

5 years agoCore: Preserve CSP nonce on scripts in DOM manipulation
Michał Gołębiowski-Owczarek [Mon, 14 Jan 2019 18:29:54 +0000 (19:29 +0100)]
Core: Preserve CSP nonce on scripts in DOM manipulation

Fixes gh-3541
Closes gh-4269

5 years agoTests: Exclude Android 4.x from repeated header names test
Michał Gołębiowski-Owczarek [Fri, 14 Dec 2018 21:06:44 +0000 (22:06 +0100)]
Tests: Exclude Android 4.x from repeated header names test

Android Browser only returns the last value for each header so there's no way
for jQuery get all parts.

Closes gh-4259
Ref gh-3403
Ref gh-4173

5 years agoManipulation: Restore _evalUrl jQuery.ajax calls to dataType: script
Richard Gibson [Thu, 13 Dec 2018 17:54:39 +0000 (12:54 -0500)]
Manipulation: Restore _evalUrl jQuery.ajax calls to dataType: script

IE and iOS <10 XHR transport does not succeed on data: URIs
Ref gh-4243
Ref gh-4126
Closes gh-4258

5 years agoManipulation: Only evaluate HTTP-successful script src
Richard Gibson [Wed, 12 Dec 2018 16:21:24 +0000 (11:21 -0500)]
Manipulation: Only evaluate HTTP-successful script src

Fixes gh-4126
Closes gh-4243

5 years agoCore: Tiny efficiency fix to jQuery.extend / jQuery.fn.extend (#4246)
Marja Hölttä [Wed, 12 Dec 2018 16:13:18 +0000 (17:13 +0100)]
Core: Tiny efficiency fix to jQuery.extend / jQuery.fn.extend (#4246)

Read target[name] only when it's needed.

In addition to doing the property read-only when needed, this
avoids a slow path in V8 (see the issue for more details).

Fixes gh-4245
Closes gh-4246

5 years agoTests: fix dimensions tests in testswarm
Timmy Willison [Mon, 3 Dec 2018 17:03:04 +0000 (12:03 -0500)]
Tests: fix dimensions tests in testswarm

Close gh-4248

5 years agoDimensions: fall back to offsetWidth/Height for border-box in IE
Timmy Willison [Sun, 11 Nov 2018 22:34:43 +0000 (17:34 -0500)]
Dimensions: fall back to offsetWidth/Height for border-box in IE

- Use getClientRects() to explicitly detect hidden/disconnected
  elements

Close gh-4223
Fixes gh-4102

5 years agoTests: add IE launcher for debugging IE11 on Windows
Timmy Willison [Mon, 12 Nov 2018 16:49:44 +0000 (11:49 -0500)]
Tests: add IE launcher for debugging IE11 on Windows

5 years agoTests: fix ajax test failure; add to header instead of replace
Timmy Willison [Mon, 26 Nov 2018 17:46:58 +0000 (12:46 -0500)]
Tests: fix ajax test failure; add to header instead of replace

5 years agoAjax: Fix getResponseHeader(key) for IE11
Andrei Fangli [Mon, 26 Nov 2018 17:00:41 +0000 (19:00 +0200)]
Ajax: Fix getResponseHeader(key) for IE11

- getResponseHeader(key) combines all header values for the provided key into a
single result where values are concatenated by ', '. This does not happen for
IE11 since multiple values for the same header are returned on separate lines.
This makes the function only return the last value of the header for IE11.
- Updated ajax headers test to better cover Object.prototype collisions

Close gh-4173
Fixes gh-3403

5 years agoTests: Add Safari 12 & iOS 12 results
Michał Gołębiowski-Owczarek [Mon, 12 Nov 2018 17:55:47 +0000 (18:55 +0100)]
Tests: Add Safari 12 & iOS 12 results

5 years agoTests: Move latest Firefox before Firefox 60 test results
Michał Gołębiowski-Owczarek [Mon, 12 Nov 2018 17:54:15 +0000 (18:54 +0100)]
Tests: Move latest Firefox before Firefox 60 test results

5 years agoCore: Recognize Shadow DOM in attachment checks
Saptak Sengupta [Fri, 9 Nov 2018 11:15:31 +0000 (16:45 +0530)]
Core: Recognize Shadow DOM in attachment checks

Allow `isAttached` to check Shadow DOM for attachment.

Fixes gh-3504
Closes gh-3996
Ref gh-3977

5 years agoBuild: Run tests on Node.js 11 as well
Michał Gołębiowski-Owczarek [Wed, 31 Oct 2018 14:50:09 +0000 (15:50 +0100)]
Build: Run tests on Node.js 11 as well

6 years agoCSS: Don't read styles.position in the width/height cssHook unless necessary
Michał Gołębiowski-Owczarek [Mon, 8 Oct 2018 16:25:15 +0000 (18:25 +0200)]
CSS: Don't read styles.position in the width/height cssHook unless necessary

Current width/height cssHook reads the computed position style even if not
necessary as the browser passes the scrollboxSize support test. That has been
changed.

This commit also makes the scrollboxSize support test in line with all others
(i.e. only return true or false) and changes the variable name in the hook
to make the code clearer.

Fixes gh-4185
Closes gh-4187

6 years agoTests: Add tests for not auto-appending "px" to CSS Grid properties
Michał Gołębiowski-Owczarek [Wed, 3 Oct 2018 10:00:52 +0000 (12:00 +0200)]
Tests: Add tests for not auto-appending "px" to CSS Grid properties

Ref gh-4007
Ref gh-4028
Closes gh-4165

6 years agoTests: Allow Karma to load unminfied source
Richard Gibson [Fri, 7 Sep 2018 14:14:01 +0000 (10:14 -0400)]
Tests: Allow Karma to load unminfied source

Closes gh-4128

6 years agoCSS: Don't auto-append "px" to possibly-unitless CSS grid properties
Bert Zhang [Wed, 29 Aug 2018 13:54:27 +0000 (06:54 -0700)]
CSS: Don't auto-append "px" to possibly-unitless CSS grid properties

This commit adds some CSS grid-related properties to jQuery.cssNumber.

Fixes gh-4007

6 years agoTests: use width style instead of SVG width attribute (#4157)
Jason Bedard [Tue, 21 Aug 2018 04:13:33 +0000 (21:13 -0700)]
Tests: use width style instead of SVG width attribute (#4157)

The SVG width attribute seems to not support border-box in iOS7.

Closes gh-4155

6 years agoTests: Account for the iPad with iOS 11.3 user agent
Michał Gołębiowski-Owczarek [Wed, 1 Aug 2018 13:12:30 +0000 (15:12 +0200)]
Tests: Account for the iPad with iOS 11.3 user agent

The user agent of the iPad with iOS 11.3 on BrowserStack is missing the "iPhone"
part in the "iPhone OS 11_3" part. This commit makes the iOS regex accept such
(probably?) malformed UAs.

6 years agoTests: Skip module tests in Edge
Michał Gołębiowski-Owczarek [Mon, 30 Jul 2018 16:41:08 +0000 (18:41 +0200)]
Tests: Skip module tests in Edge

Edge sometimes doesn't execute module scripts. It needs to be investigated why
but for now, we're skipping the test to make our tests more stable.

Closes gh-4140

6 years agoTests: Make support tests pass in Firefox 52
Michał Gołębiowski-Owczarek [Mon, 30 Jul 2018 16:06:08 +0000 (18:06 +0200)]
Tests: Make support tests pass in Firefox 52

jQuery Core now supports Firefox ESR.

6 years agoDocs: add gitter badge to README.md
Timmy Willison [Fri, 27 Jul 2018 17:00:28 +0000 (13:00 -0400)]
Docs: add gitter badge to README.md

Close gh-4138