Commit Graph

2658 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
03cde342cd
All: Remove the deprecated ui/core.js file
Also, fix checkboxradio visual tests.

Ref gh-2249
2024-05-15 00:38:40 +02:00
Michał Gołębiowski-Owczarek
9887579b61
All: Stop relying on jquery-patch.js internally, add tests
Avoid relying on jQuery patches. Instead:
* use `CSS.escape` instead of `jQuery.escapeSelector`
* use `.filter()` with a proper handler instead of `.even()`

Keep `jquery-patch.js` for backwards compatibility, though.

Also, add tests for jquery-patch.

Ref gh-2249
2024-05-15 00:38:40 +02:00
Michał Gołębiowski-Owczarek
bb49bd794b
All: Drop support for IE & some other browsers (but mostly IE)
Closes gh-2249
2024-05-15 00:38:40 +02:00
Michał Gołębiowski-Owczarek
daa6fb55b3
All: Drop support for jQueries different than the latest for each major
Also, remove the ability to run the test suite in jQuery <1.12.4 & <2.2.4.

Closes gh-2249
2024-05-15 00:38:30 +02:00
Michał Gołębiowski-Owczarek
ac8b1e4eee
Core: Make back compat disabled by default
Closes gh-2250
2024-05-13 18:11:57 +02:00
Michał Gołębiowski-Owczarek
8e34aa6155
Docs: Update leftover HTTP Trac URLs to HTTPS 2024-04-26 17:28:11 +02:00
Michał Gołębiowski-Owczarek
4966aea381
Docs: Change a few most common domains from HTTP to HTTPS
Also, update a few stale URLs to what they redirect now to.

Closes gh-2244
2024-04-26 16:25:34 +02:00
Michał Gołębiowski-Owczarek
1374020009
Tests: Skip a problematic keyboard test in IE with jQuery 3.6
jQuery 3.6 has issues with focus handling in IE which breaks this test.
The issues were fixed in jQuery 3.7, so we just accept them here.

Closes gh-2231
2024-04-12 15:23:31 +02:00
Michał Gołębiowski-Owczarek
e7a0da63ea
Tests: Increase robustness of a draggable revert test
One of the changes is increasing `revertDuration` from 200 to 300. For some
reason, when jQuery 3.1 is used in an iframe (which TestSwarm uses) the timings
are lower than expected and `setTimeout` too slow and the check for animation
happens too late.

Closes gh-2230
2024-04-12 15:23:05 +02:00
Michał Gołębiowski-Owczarek
ab2a2a973e
Tests: Workaround a jQuery 1.8 issue with one dialog test
The test "#8958: dialog can be opened while opening" had special behavior in
jQuery 1.8 and the patch from commit 7adb13ac7c
broke those assumptions. Adjust the test so that it passes again.

Closes gh-2229
2024-04-12 15:22:05 +02:00
Timmy Willison
4af5caed7a
Tests: align test runner with other repos
Close gh-2234
2024-04-09 13:31:27 -04:00
Timmy Willison
91df20be6b
Tests: replace grunt-contrib-qunit with jQuery test runner
- add filestash workflow

Close gh-2221
2024-03-29 09:13:46 -04:00
Michał Gołębiowski-Owczarek
802642c373
Tests: Fix tests with the Git Core build
jQuery PR jquery/jquery#5452 removed special handling of boolean attributes.
Thankfully, this only broke a single jQuery UI test.

Closes gh-2220
2024-03-26 16:17:00 +01:00
Michał Gołębiowski-Owczarek
1be4538817
Build: Add jQuery 3.7.0 2023-05-12 00:48:38 +02:00
Michał Gołębiowski-Owczarek
ba249efb6b
Tests: Workaround IE issues in qunit-assert-domequal
In IE, `option` elements may have different initial `option` colors.
They may initially all be transparent, but later the selected
option gets a blue background with white text; we now ignore it.

The logic of `qunit-assert-domequal` was also fixed to use the same
method of fetching styles in all browsers; IE used to get a legacy
one meant for IE <9 due to a mistake in the performed check.
2023-05-10 17:34:14 +02:00
Michał Gołębiowski-Owczarek
613b522e9a
Tests: Make resizable tests a bit more forgiving 2023-05-10 17:34:14 +02:00
Michał Gołębiowski-Owczarek
b715135d11
Tests: Workaround a dialog test issue by a proper cleanup
The `#favorite-animal` focus & blur handlers used to not be cleaned up after
the test automatically, leading to issues with some jQuery versions.
2023-05-10 17:34:14 +02:00
Michał Gołębiowski-Owczarek
23655f0dbd
Tests: Fix selectmenu width tests in Firefox with jQuery 3.0 & 3.1
jQuery 3.0 & 3.1 used `getBoundingClientRect()` in its `width`/`height`
calculations and that causes minor differences in fractional width computations.
Allow a tiny delta in tests to fix those tests breaking in Firefox.

Ref jquery/jquery#3561
Closes gh-2159
2023-05-10 10:56:02 +02:00
Michał Gołębiowski-Owczarek
020828e7ff
Selectmenu: Fix selecting options following hidden ones
Change a2b25ef6ca made options with
the `hidden` attribute skipped when rendering. However, that makes
indexes misaligned with native options as hidden ones maintain their
index values. Instead, don't skip hidden options but add the `hidden`
attribute to the respective jQuery UI elements as well.

Fixes gh-2082
Closes gh-2144
Ref a2b25ef6ca
2023-05-10 10:55:01 +02:00
Michał Gołębiowski-Owczarek
beeb410ccb
Build: Add jQuery 3.6.4, update Migrate to 3.4.1
Closes gh-2161
2023-05-10 10:54:31 +02:00
Michał Gołębiowski-Owczarek
546214e869 Build: Fork vendors to remove QUnit deprecated API usage
Changes:
* add `tests/lib/vendor/**/*` to `.eslintignore`
* move `qunit-composite` to `tests/lib` so that we can modify it
* move `qunit-assert-classes` to `tests/lib` so that we can modify it
* move `qunit-assert-close` to `tests/lib` so that we can modify it
* replace `assert.push` with `assert.pushResult`
* remove usage of `QUnit.extend`

Closes gh-2157
2023-05-10 10:53:57 +02:00
Michał Gołębiowski-Owczarek
360259e2b2 Tests: Make Puppeter really fire Chrome on macOS
Also, workaround issues with QUnit Chrome bridge: the Chrome bridge
from `grunt-contrib-qunit` is now getting injected into every single
iframe, including an empty one that has no intention of running QUnit
tests. Since that bridge requires QUnit, it fails with an error
in such cases. Workaround the issue by wrapping the bridge in
another function that bails early if QUnit is not defined.

Ref gh-2157
2023-05-10 10:53:57 +02:00
Michał Gołębiowski-Owczarek
f36fe9e50d Tests: Switch from QUnit.jsDump to QUnit.dump
`QUnit.jsDump` was renamed to `QUnit.dump` in QUnit 2.0.

Ref gh-2157
2023-05-10 10:53:57 +02:00
Michał Gołębiowski-Owczarek
9dc2bf9737 Tests: Fix tooltip tests by destroying tooltips
Some tests were not properly destroying tooltips which made tests
start to fail with the new QUnit.

Ref gh-2157
2023-05-10 10:53:57 +02:00
Michał Gołębiowski-Owczarek
0977ea1b48 Demos:Tests: Avoid self-closing HTML tags
Self-closing tags are reported by newer versions of the htmllint
Grunt plugin. They also don't make sense in our HTML files
since they are not XHTML-compliant and they run in HTML mode
anyway.

Ref gh-2157
2023-05-10 10:53:57 +02:00
Kenneth DeBacker
f8990e68e2
Tests: Test only valid values for Datepicker defaultDate, min/maxDate
The docs say that valid periods when using string value and
period pairs as relative dates are "y", "m", "w", and "d"
https://api.jqueryui.com/datepicker/

Closes gh-2143
2023-03-30 13:05:41 +02:00
Michał Gołębiowski-Owczarek
3286792ec5
Build: Add jQuery 3.6.1-3.6.3, update Migrate to 3.4.0 2023-01-15 21:41:18 +01:00
Matías Cánepa
62f2ccc567
Resizable: Fix resizing of elems with box-sizing: border-box
Fixes gh-1979
Closes gh-2012
2022-10-10 11:00:50 +02:00
Michał Gołębiowski-Owczarek
8cc5bae1ca
Checkboxradio: Don't re-evaluate text labels as HTML
If you generate a Checkboxradio from a checkbox/radio with a label that
contains encoded HTML, e.g. `&lt;em&gt;test&lt;/em&gt;` this will work fine
at first. If, however a refresh is triggered on that instance (explicitly or
e.g. by turning it into a `Controlgroup`), the previously escaped HTML will
now be evaluated.

If the label was created based on some user input, this could lead to
unexpected code execution even though the initial output was escaped.

Fixes gh-2101
Closes gh-2102
2022-07-14 20:52:02 +02:00
Michał Gołębiowski-Owczarek
b53e7beb68 All: Remove deprecated .click() usage in demos/tests 2022-07-14 20:34:29 +02:00
Michał Gołębiowski-Owczarek
0c5becce0e
Widget: Optimize attachment of the _untrackClassesElement listener
jQuery UI 1.13.0 changed the logic attaching the `_untrackClassesElement`
listener in the `_classes` widget method; one of the side effects was calling
`this._on` for each node that needed the listener. That caused a severe
performance degradation for large comboboxes as each `_on` jQuery UI call
causes a jQuery `add` call that calls Sizzle's `uniqueSort` underneath.

Instead, collect the nodes that need the listener and then, outside of the loop,
create a jQuery object out of them and attach the listener once. That's still
slower than the jQuery 1.12 version but only slightly: 936 ms to 1.03s on a very
large list on a recent MacBook Pro, compared to ~30 seconds before this patch.

Fixes gh-2014
Closes gh-2037
2022-01-15 01:26:23 +01:00
Ben Mullins
933ce5d779
Autocomplete: Rewrite with a delay instead of appending the live region
This fixes the issue caused by https://bugs.jqueryui.com/ticket/9357.
We now empty the live region instead of appending to it, and we do so
after a brief timeout so the live region isn't updated on every mousemove
event or when quickly traversing through options.

Fixes gh-2002
Closes gh-2031
2022-01-05 11:35:34 +01:00
Michał Gołębiowski-Owczarek
ed637b04d7
Widget: Make contextless widget construction work
Due to the fact the widget factory code is now in strict mode, the check for
being called without using the `new` keyword started breaking if you save the
widget constructor to a variable before calling it:
```js
var customWidget = $.custom.customWidget;
customWidget( {}, elem );
```
as then `this` is undefined and checking for `this._createWidget` crashes.
Account for that with an additional check.

Fixes gh-2015
Closes gh-2019
2021-11-19 00:47:56 +01:00
Michał Gołębiowski-Owczarek
b52ee4012d
Sortable: Fix positioning when moving a Draggable item into a Sortable
PR gh-1793 removed setting `this.offset.parent` in the Draggable
`refreshPositions` method which broke position calculations when moving
a Draggable item into a connected Sortable. restore that assignment.

Ref gh-1793
Fixes gh-2001
Closes gh-2009
2021-11-15 18:39:25 +01:00
Michał Gołębiowski-Owczarek
efe3b22517
Sortable: Allow 0-height containers to be sortable as in 1.12.1
Note that container specific events will not fire when the dragged element
is interacting with zero height containers.

Fixes gh-1998
Closes gh-2008

Co-authored-by: A. Wells <borgboyone@users.noreply.github.com>
2021-11-08 18:21:03 +01:00
Josep Sanz
85fba3f107
Tooltip: Don't crash on empty content
Commit 1f2011ece removed a `try-catch` around triggering the `remove` handlers
in the `jQuery.cleanData` override. The `try-catch` was meant for old IE but it was
also catching an error coming from the tooltip `remove` handler depending on
being able to find a relevant tooltip. The `_find` method returns `null`, though,
when the tooltip cotent is empty.

Instead of restoring the `try-catch`, handle the `null` case in the `remove` handler.

Fixes gh-1990
Closes gh-1994

Co-authored-by: Claas Augner <github@caugner.de>
Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
2021-11-08 11:53:45 +01:00
Michał Gołębiowski-Owczarek
c3749ca924 Tests: Take development jQuery versions from releases.jquery.com
code.jquery.com is now used just for the specific versions.
2021-09-29 19:07:43 +02:00
Michał Gołębiowski-Owczarek
232fe3bafa Tests: Load the TestSwarm listener via HTTPS 2021-09-29 17:22:17 +02:00
Michał Gołębiowski-Owczarek
3f5c7201da Tests: Update the default jQuery version from 1.12.4 to 3.6.0 2021-09-25 12:24:55 +02:00
Michał Gołębiowski-Owczarek
70dae67b73
Build: Migrate from JSHint & JSCS to ESLint
Fixes #15393
Closes gh-1958
2021-06-07 00:58:12 +02:00
Patrick McKay
a12c98574d Datepicker: Improve callbacks test for onUpdateDatepicker
Make sure the custom element added by the onUpdateDatepicker callback still exists and is not duplicated after calling refresh and setDate.
2021-05-21 17:58:10 +02:00
Patrick McKay
17d115b829 Datepicker: Add option for onUpdateDatepicker callback
Add a new option named onUpdateDatepicker that allows a custom callback
to be provided. If provided, the callback is called at the end of
$.datepicker._updateDatepicker.
2021-05-21 17:58:10 +02:00
Michał Gołębiowski-Owczarek
7c6a9f0128
All: Drop $.ui.escapeSelector in favor of $.escapeSelector
Fixes #14991
Closes gh-1957
2021-05-14 23:37:19 +02:00
Michał Gołębiowski-Owczarek
afe20b79a6
Datepicker: Make sure text option are text, shorten HTML strings
Instead of using enormous HTML strings, various elements are now constructed
using jQuery APIs. This makes it more obvious user-provided data is used
correctly.

Fixes #15284
Closes gh-1953
2021-05-12 00:59:42 +02:00
Michał Gołębiowski-Owczarek
effa323f15
Position: Make sure of is treated as a CSS selector
Closes gh-1955
2021-05-04 13:31:39 +02:00
Michał Gołębiowski-Owczarek
32850869d3
Datepicker: Make sure altField is treated as a CSS selector
Closes gh-1954
2021-05-04 13:30:06 +02:00
Michał Gołębiowski-Owczarek
9380d2734e
Tests: Accept delayed focusout in IE with jQuery 1.8
In IE with jQuery 1.8 focusout may not happen immediately so some checks
need to be done later.

Closes gh-1952
2021-04-16 23:33:57 +02:00
Michał Gołębiowski-Owczarek
dff0dc0d6a
Tests: Fix the "dialog: core: focus tabbable" test in IE
In IE in jQuery 3.4+ a sequence:
```js
$( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" );
```
doesn't end up with a focused input. However, in this test we only want to check
that the last focused input receives the focus back when `_focusTabbable()` is
called which in reality doesn't happen so quickly so let's avoid the issue by
waiting a bit.

Ref jquery/jquery#4856
Closes gh-1951
2021-03-16 22:17:25 +01:00
Michał Gołębiowski-Owczarek
9ea690a0d9
Tests: Make some number comparisons less strict
Some of the APIs return fractional values in newer jQueries, making comparisons
sometimes not being 100% accurate. Allow some delta.

This is similar to what was already done in
98b539171b but a few cases affecting IE and/or
Edge Legacy were missed.

Closes gh-1947
2021-03-09 00:11:40 +01:00
Michał Gołębiowski-Owczarek
e6592a8aff
Build: Add jQuery 3.6.0, update Migrate from 3.3.1 to 3.3.2
Closes gh-1948
2021-03-09 00:09:51 +01:00