Commit Graph

6404 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
79b74e043a
Selector: Port Sizzle tests to jQuery
Apart from porting most Sizzle tests to jQuery (mostly to its selector module),
this commit fixes selector-native so that a jQuery custom compilation that
excludes Sizzle passes all tests as well.

Closes gh-4406
2019-06-26 21:39:10 +02:00
Michał Gołębiowski-Owczarek
438b1a3e8a
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
2019-05-13 22:25:11 +02:00
Michał Gołębiowski-Owczarek
9ec09c3b4a
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
2019-05-13 21:55:45 +02:00
Michał Gołębiowski-Owczarek
3527a38405
Core: Remove IE-specific support tests, rely on document.documentMode
Also, update some tests to IE-sniff when deciding whether
to skip a test.

Fixes gh-4386
Closes gh-4387
2019-05-13 21:39:56 +02:00
Michał Gołębiowski-Owczarek
ccbd6b9342
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.

Closes gh-4390
Ref gh-4384
Ref gh-4385
2019-05-08 10:12:36 +02:00
Pat O'Callaghan
4d865d96aa Traversing: Fix contents() on <object>s with children
Fixes gh-4384
Closes gh-4385
2019-05-06 19:23:00 +02:00
Wonseop Kim
110802c7f2 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
2019-05-01 14:57:55 +02:00
Michał Gołębiowski-Owczarek
b220f6df88
Build: Fix AMD dependencies in curCSS
A leftover `rboxStyle` was left in the wrapper parameters but not in the
dependency array, causing `getStyles` to be undefined in AMD mode.

Since `rboxStyle` is no longer used, it's now removed.

Ref gh-4347
Closes gh-4380
2019-04-30 21:21:18 +02:00
Michał Gołębiowski-Owczarek
cf84696fd1
Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJS
Also, update support comments format to match format described in:
https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
with the change from:
https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379
(open-ended ranges end with `+`).

Fixes gh-3950
Fixes gh-4299
Closes gh-4347
2019-04-29 22:56:09 +02:00
Richard Gibson
bde53edcf4 Tests: Restrict an event test fallback to TestSwarm
Closes gh-4357
2019-04-29 22:12:59 +02:00
Michał Gołębiowski-Owczarek
58f0c00bed
Core: Remove deprecated jQuery APIs
Fixes gh-4056
Closes gh-4364
2019-04-29 22:04:52 +02:00
Michał Gołębiowski-Owczarek
6f2fae7c41 Tests: Fix the new focusin/focusout test in IE
In IE, focus & blur events fire asynchronously, the test now accounts for that.

Ref gh-4362
2019-04-29 21:40:36 +02:00
Michał Gołębiowski-Owczarek
8a74137693
Event: Stop shimming focusin & focusout events
Latest versions of all browsers now implement focusin & focusout natively
and they all converged on a common event order so it doesn't make much sense
for us to normalize it to a different order anymore.

Note that it means we no longer guarantee that focusin fires before focus
and focusout before blur.

Fixes gh-4300
Closes gh-4362
2019-04-29 21:13:36 +02:00
Michał Gołębiowski-Owczarek
8fae21200e
Data: Separate data & css/effects camelCase implementations
The camelCase implementation used by the data module no longer turns `-ms-foo`
into `msFoo` but to `MsFoo` now. This is because `data` is supposed to be
a generic utility not specifically bound to CSS use cases.

Fixes gh-3355
Closes gh-4365
2019-04-29 21:06:53 +02:00
Richard Gibson
eb6c0a7c97 Event: Prevent leverageNative from registering duplicate dummy handlers
(cherry-picked from 6c1e7dbf73)

Closes gh-4353
2019-04-29 20:50:00 +02:00
Richard Gibson
ddfa837664 Event: Fix handling of multiple async focus events
(cherry-picked from 24d71ac704)

Fixes gh-4350
Closes gh-4354
2019-04-29 20:49:30 +02:00
Michał Gołębiowski-Owczarek
b8d4712825
Build: Test on Node.js 12, stop testing on Node.js 6 & 11
Closes gh-4369
2019-04-23 22:44:15 +02:00
Michał Gołębiowski-Owczarek
874030583c
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.

Fixes gh-4358
Closes gh-4361
2019-04-17 19:56:25 +02:00
Timmy Willison
cf9fe0f6a1
Release: update AUTHORS.txt 2019-04-09 17:17:10 -04:00
Michał Gołębiowski-Owczarek
0b2c36adb4
Build: Update Sizzle from 2.3.3 to 2.3.4
Fixes gh-1756
Fixes gh-4170
Fixes gh-4249
Closes gh-4345
2019-04-09 09:50:45 +02:00
Michał Gołębiowski-Owczarek
00a9c2e5f4 CSS: Don't automatically add "px" to properties with a few exceptions
Fixes gh-2795
Closes gh-4055
Ref gh-4009
2019-04-08 19:26:08 +02:00
Michał Gołębiowski-Owczarek
c4f2fa2fb3 Build: Update the master version to 4.0.0-pre 2019-04-08 18:21:36 +02:00
Michał Gołębiowski-Owczarek
2e4b79ab8f
Tests: Fix the core-js polyfill inclusion method
core-js 3 no longer includes a built file in the bundle but core-js-bundle
does.

Closes gh-4342
Ref gh-4341
2019-04-04 23:45:57 +02:00
Michał Gołębiowski-Owczarek
fea7a2a328
Build: Update Sinon from 2.3.7 to 7.3.1, other updates
Closes gh-4341
2019-04-04 16:53:38 +02:00
Timmy Willison
9b9fca45f3
Update README.md 2019-04-02 12:31:43 -04:00
Michał Gołębiowski-Owczarek
a2a73db99c
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
2019-03-27 15:47:33 +01:00
Michał Gołębiowski-Owczarek
4455f8db4e
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
2019-03-27 15:46:20 +01:00
buddh4
005040379d Core: Preserve CSP nonce on scripts with src attribute in DOM manipulation
Fixes gh-4323
Closes gh-4328
2019-03-25 18:14:24 +01:00
Richard Gibson
fe5f04de8f Event: Prevent leverageNative from double-firing focusin
Also, reduce size.

Closes gh-4329
Ref gh-4279
2019-03-25 18:12:08 +01:00
Michał Gołębiowski-Owczarek
753d591aea
Core: Prevent Object.prototype pollution for $.extend( true, ... )
Closes gh-4333
2019-03-25 17:57:30 +01:00
Richard Gibson
669f720edc 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
   b442abacbb 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
2019-03-20 16:40:16 +01:00
Michał Gołębiowski-Owczarek
a0abd15b9e
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
2019-03-18 18:44:43 +01:00
Michał Gołębiowski-Owczarek
0ec25abba2
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
2019-03-11 20:03:54 +01:00
Michał Gołębiowski-Owczarek
84b6a0beb1
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
2019-03-11 17:25:48 +01:00
Michał Gołębiowski-Owczarek
ca9356ecce
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
2019-03-11 16:06:17 +01:00
Michał Gołębiowski-Owczarek
6ced2639b5
Build: Update QUnit from 1.23.1 to 2.9.2
Closes gh-4307
2019-03-04 20:10:21 +01:00
Michał Gołębiowski-Owczarek
16ad9889f5
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
2019-03-04 19:05:09 +01:00
Michał Gołębiowski-Owczarek
9cb124ed00
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
2019-03-04 18:30:51 +01:00
Michał Gołębiowski-Owczarek
c10945d0e1
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
2019-02-19 13:20:57 +01:00
abnud1
8751e9ef86 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
2019-02-19 13:05:09 +01:00
abnud1
c349818742 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
2019-02-18 19:03:26 +01:00
Michał Gołębiowski-Owczarek
da44ff39c2
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
2019-01-29 14:13:53 +01:00
Michał Gołębiowski-Owczarek
5bdc85b82b
Core: Support passing nonce through jQuery.globalEval
Fixes gh-4278
Closes gh-4280
Ref gh-3541
Ref gh-4269
2019-01-21 18:42:39 +01:00
Michał Gołębiowski-Owczarek
e4de8b4626
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
2019-01-21 18:34:40 +01:00
Michał Gołębiowski-Owczarek
543d3d24ea 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 c7c2855ed1
2019-01-14 19:49:28 +01:00
Michał Gołębiowski-Owczarek
c7c2855ed1
Core: Preserve CSP nonce on scripts in DOM manipulation
Fixes gh-3541
Closes gh-4269
2019-01-14 19:29:54 +01:00
Michał Gołębiowski-Owczarek
9cb162f6b6
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
2018-12-14 22:06:44 +01:00
Richard Gibson
13de7c9ede
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
2018-12-13 12:54:39 -05:00
Richard Gibson
c2026b117d Manipulation: Only evaluate HTTP-successful script src
Fixes gh-4126
Closes gh-4243
2018-12-12 17:21:24 +01:00
Marja Hölttä
4ffb1df8e4 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
2018-12-12 17:13:18 +01:00