Commit Graph

2658 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
5b5fda7cd2
Tests: Account for an extra noop focus/blur listener in jQuery >=3.4
jQuery >=3.4.0 uses a special focus/blur handler pair needed to fix various
issues with checkboxes/radio buttons as well as being able to pass data in focus
triggers. This leaves extra focus & blur events if any of these events were ever
listened to at a particular element.

We've started skipping these handlers in the `domEqual` assertion in gh-1930 but
we missed a case where an event is triggered before any handler is attached -
jQuery >=3.4.0 attaches then an extra noop listener just to force the code path
to go through the setup code before the trigger happens. We now skip this extra
handler as well.

This fixes a test failure in "dialog: methods" destroy tests.

Closes gh-1945
Ref jquery/jquery#4496
Ref gh-1930
2021-02-20 19:11:03 +01:00
Micah Miller
a22361dbe4 Build: Update to the latest version of Grunt & many other packages
JSHint, JSCS & QUnit-related packages are not updated as they need more code
adjustments.

Fixes #15112
Closes gh-1882
2020-10-14 23:55:35 +02:00
Paul Capron
f5d38e2e05
Focusable: Fix handling of visibility: collapse
"collapse" is similar to "hidden", with a slight difference in the case
of tr/tbody/td/colgroup elements.
See https://www.w3.org/TR/CSS22/visufx.html#visibility
See https://www.w3.org/TR/CSS22/tables.html#dynamic-effects
See https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#Table_example

"visibility: collapse" elements are always not focusable, though.

Commit d3025968f3 introduced a regression by testing with `!== "hidden"`
instead of `=== "visible"`.

Closes gh-1843
2020-10-14 23:53:11 +02:00
Michał Gołębiowski-Owczarek
d2f577f13b
Tests: Update jQuery Migrate from 3.3.0 to 3.3.1
That upgrade makes UI pass the whole test suite without a single jQuery Migrate
warning. 🎉

Closes gh-1932
2020-07-27 21:03:48 +02:00
Michał Gołębiowski-Owczarek
5e2fc44c0c
Tests: Account for extra focus/blur listeners in jQuery >=3.4
jQuery >=3.4.0 uses a special focus/blur handler pair
needed to fix various issues with checkboxes/radio buttons
as well as being able to pass data in focus triggers.
However, this leaves dummy focus & blur events if any of these
events were ever listened to at a particular element. There's not
a lot UI can do to fix this so we now just skip these handlers for
data comparisons in tests.

Ref jquery/jquery#4496
Closes gh-1930

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2020-07-23 15:54:16 +02:00
Michał Gołębiowski-Owczarek
91037d66b0
Tests: Accept a small difference of animated width/height
jQuery 3.2 & newer have a different animation logic and the animated elements
width/height differ from the starting ones even at the beginning of the
animation. The point of the assertions checking that they're identical was
to ensure bug #5245 is fixed; that issue manifested by a big jump to half the
element size. To test for that, it's enough to check that the first obtained
values are close to the original ones.

This makes effects tests pass in all supported jQuery versions.

Closes gh-1928
Ref #5245
2020-07-23 15:53:36 +02:00
Michał Gołębiowski-Owczarek
b8ec78a37a
Tests: Skip a scrollbar test in jQuery 3.2
jQuery 3.2 incorrectly handle scrollbars in WebKit/Blink-based browsers.
This is fixed in version 3.3, see https://github.com/jquery/jquery/issues/3589.
As the data here comes from jQuery directly and the changes to fix it
are non-trivial: https://github.com/jquery/jquery/pull/3656, just accept
that scrollbar data in this jQuery version is inaccurate.

Closes gh-1927
Ref jquery/jquery#3589
Ref jquery/jquery#3656
2020-07-23 15:51:15 +02:00
Michał Gołębiowski-Owczarek
42bcdb90f6
Tests: Clear the timers queue in an animateClass test
jQueries older than 1.11 or 2.1 were leaving a timer in the queue which could
then influence other tests.

Closes gh-1926
2020-07-23 15:49:27 +02:00
Michał Gołębiowski-Owczarek
b61b16b5a8
All: Drop support for jQuery 1.7
Closes gh-1923
2020-07-22 16:04:47 +02:00
Michał Gołębiowski-Owczarek
e7a10c70ae
Tests: Ensure no timers are running at the end of each test (#1920)
This helps fix issues that make tooltip tests sometimes fail when run against
jQuery 3.2 or newer due to timing differences.

Details:
* Add the `moduleAfterEach` function ensuring no timers are running.
* Attach this function via `common.testWidget`.
* Attach this function to most test suites.
* Add a tooltip test helper cleaning up leftover timers.
* Rename legacy `setup`/`teardown` hooks to `beforeEach`/`afterEach`.

Closes gh-1920
2020-05-16 09:16:24 +02:00
Michał Gołębiowski-Owczarek
f4ef03e57e
All: Resolve most jQuery Migrate warnings
Closes gh-1919
2020-05-16 08:36:55 +02:00
Michał Gołębiowski-Owczarek
b36d542569
Tests: Load jQuery Migrate before UI test files
This is necessary to catch all possible warnings that the test files
may trigger.

Closes gh-1918
2020-05-16 08:30:11 +02:00
Michał Gołębiowski-Owczarek
7caf8f61df
Build: Rename jquery-1-7 to jquery-patch
The file now contains many more than just jQuery 1.7 patches.

Closes gh-1917
2020-05-16 08:29:08 +02:00
Michał Gołębiowski-Owczarek
579bedd7d2
Tests: Solve a frequent race condition in tests in Chrome/Safari
Closes gh-1916
2020-05-16 08:28:26 +02:00
Michał Gołębiowski-Owczarek
d37ebc624d
Build: Add jQuery 3.5.0 & 3.5.1
Closes gh-1915
2020-05-16 08:27:27 +02:00
Michał Gołębiowski-Owczarek
512cbbf4d9
Build: Update jQuery Simulate, jQuery Migrate & jQuery Color
The jQuery Simulate & jQuery Color updates are needed for compatibility
with jQuery master, a future jQuery 4.

Closes gh-1914
2020-05-16 08:26:48 +02:00
jigar gala
817ce38555 Datepicker: Fixed current instance memory leak and added unit testcases 2020-03-23 21:49:23 +01:00
Michał Gołębiowski-Owczarek
0c860b0d92
All: Remove usage of jQuery positional selectors
jQuery positional selectors () have been deprecated in
[jQuery 3.4.0](https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/)
and they'll be removed in jQuery 4.0.0. This PR removes their usage.

Most of the changes were possible without changing public API. However,
dropping `:even` usage required a change to the
[`header` option](https://api.jqueryui.com/accordion/#option-header)
of the accordion widget. I made it an optional function; this will need
to be documented.

The polyfill for `.even()` & `.odd()` is added for jQuery <3.5.0. There was
no usage of the :odd selector in the code but the `.odd()` method is also
polyfilled for completeness.

Closes gh-1904
2020-01-22 16:44:34 +01:00
Michał Gołębiowski-Owczarek
3481f50bfc Tests: Add the 3.x-git jQuery version to the dropdown
Closes gh-1905
2020-01-14 14:03:23 +01:00
Michał Gołębiowski-Owczarek
98b539171b All: Migrate away from deprecated/removed Core APIs
Summary of the changes:

* Build: Add jQuery 3.2.0-3.4.1 to versions UI can be tested against
* Build: Load jQuery & Migrate via HTTPS
* Build: Add package-lock.json to .gitignore
* Build: Update jQuery Migrate from 3.0.0 to 3.1.0
* Build: Allow to run tests against jQuery 3.x-git
* Build: Fix formatting according to JSCS rules
* Build: Disable JSCS for the inlined jQuery Color
* All: Switch from $.isArray to Array.isArray (jQuery.isArray will be
  removed in jQuery 4.0)
* All: Switch from `$.isFunction( x )` to `typeof x === "function"`
  (jQuery.isFunction will be removed in jQuery 4.0)
* All: Inline jQuery.isWindow as it'll be removed in jQuery 4.0
* Effects: Fix a timing issue in a variable declaration. Previously,
  a jQuery object was created, chained & assigned to a variable that
  was then accessed in a callback used inside of this chained
  definition. Due to a timing difference in when the callback fired for
  the first time in latest jQuery master, it was being called before
  the variable was defined.
* Tests: Make dialog & draggable unit tests less strict (newest jQuery
  returns fractional results in some cases, making comparisons fail when
  there's a tiny difference)
* All: Migrate from $.trim to bare String.prototype.trim (jQuery.trim
  will be deprecated in jQuery 3.5)

Closes gh-1901
2019-12-08 22:23:08 +01:00
Scott González
74f8a0ac95 Tests: Load jquery-1-7 before other modules 2017-05-31 14:09:05 -04:00
Scott González
0940cb9bd2 All: Remove uses of jQuery.camelCase()
Ref #15160
Ref gh-1813
2017-05-17 11:17:09 -04:00
Scott González
ae31f2b3b4 Tests: Load jquery-1-7 module for jQuery 2.x as well 2017-05-15 18:24:19 -04:00
Scott González
39bbe70b54 Tests: Load the jquery-1-7 module for all 1.x versions 2017-05-10 09:02:53 -04:00
Scott González
50efd6e1b0 Menu: Ignore mouse events triggered due to page scrolling
Fixes #9356
Closes gh-1806
2017-05-02 15:16:17 -04:00
Scott González
a3e953b495 Menu: Don't focus dividers when wrapping via keyboard navigation
Fixes #15157
Closes gh-1804
2017-05-02 15:12:04 -04:00
Alexander Schmitz
abc9e7ce2f Button: Fix backcompat when called on collection of mixed elements
Fixes #15109
Closes gh-1808
2017-05-02 15:11:24 -04:00
Scott González
adcf9b6f6e Labels: Handle empty sets
Fixes #15184
2017-05-02 12:42:49 -04:00
Scott González
0d25a36eec Menu: Close menus immediately on selection or click outside
Fixes #15034
Closes gh-1807
2017-04-25 06:33:00 -04:00
Scott González
b3c0a7f71d Widget: Handle Object.create(null) for options objects
Fixes #15179
Closes gh-1809
2017-04-24 12:41:29 -04:00
Konstantin Dinev
c426b9a203 Resizable: Keep user-provided handles on destroy
Closes gh-1798
Ref gh-1795
2017-04-17 14:58:12 -04:00
Konstantin Dinev
278d1e1108 Resizable: Keep user defined handles on _setOption
Fixes #15084
Closes gh-1795
2017-02-24 14:30:58 -05:00
Scott González
a3b9129be1 Spinner: Ignore mousewheel events when not focused
Fixes #15139
Closes gh-1794
2017-02-21 12:45:19 -05:00
Scott González
162377fba2 Build: Add missing semicolon 2017-02-06 10:20:50 -05:00
Eirik Sletteberg
4fa0267edc Qunit: Add bootstrap config for running tests with jQuery Migrate
Closes gh-1774
2017-02-06 08:23:18 -05:00
Scott González
a2b25ef6ca Selectmenu: Don't render options with the hidden attribute
Fixes #15098
2016-11-16 12:52:15 -05:00
Michał Gołębiowski
4673c8808b Build: Add jQuery 3.1.1
Closes gh-1766
2016-11-02 12:52:22 -04:00
Scott González
0627eb3645 Form: Rename from .form() to ._form() since its not for public use
Fixes #15074
Closes gh-1760
2016-10-11 10:15:04 -04:00
Kevin Cupp
87eab46a58 Sortable: Setting table row placeholder height to be same as sorted row
Fixes #13662
Closes gh-1578
2016-10-04 15:22:14 -04:00
milk54
b9ffc34710 Tabs: Remove presentation role
Fixes #10122
Closes gh-1748
2016-09-29 10:15:19 -04:00
Sergei Ratnikov
c481400f22 Resizable: Fix aspectRatio cannot be changed after initialization.
Fixes #4186
Closes gh-1750
2016-09-28 11:55:13 -04:00
Alexander Schmitz
89af4c292e Widget: Untrack classes elements when they are removed from the DOM
Fixes #15043
Closes gh-1744
2016-09-13 15:11:34 -04:00
Ryan Oriecuia
8c66934434 Draggable: Fix spurious blur in dialogs on mousedown
I was running into a problem with a popup menu control in a dialog; clicks
weren't working (but keyboard was working fine). It turned out that the menu
was getting destroyed before the click event could fire.

Tracked down the issue to the way draggable blurs focused controls; it was
doing the blur before it ran through the logic to figure out if the drag was
actually on the handle. I've moved the blur below these checks, so it'll only
blur things if it actually needs to handle the drag. Otherwise, it asserts no
opinion on what should and shouldn't be focused, which seems like the way
things ought to be.

Also, added a unit test to check for the expected behavior.

Fixes #15046
Closes gh-1730
2016-09-13 08:53:00 -04:00
Scott González
51461d5238 Slider: Add demo for custom handle
Fixes #15023
Closes gh-1740
2016-09-13 08:41:33 -04:00
Scott González
4e39014803 Dialog: Fix code style 2016-08-31 11:22:54 -04:00
Scott González
d2ce363200 Dialog: Allow for subpixel calculation errors in tests
Tests were failing in IE 10-11 with values that were off by 0.01 pixels.

Closes gh-1737
2016-08-31 11:01:39 -04:00
Scott González
3a45a47968 Effects: Adjust animation duration in tests
With jQuery 3 using `requestAnimationFrame()`, the `setTimeout()` timing
for short animations wasn't working consistently. This resulted in infrequent
failures everywhere (but infrequent enough that it's hard to even notice), but
consistent failures in IE and Edge. Bumping up the duration and running the
assertions in the middle seems to give consistent results.

Eventually, we should refactor this to use `requestAnimationFrame()` in the
tests themselves to avoid problems like this.

Closes gh-1738
2016-08-30 16:37:24 -04:00
Felix Nagel
ac9ca9e52c Menu: Support number pad keyboard input
Fixes #15031
Closes gh-1732
2016-08-24 11:56:26 -04:00
Scott González
3dd8a09b44 Widget: instance() should return undefined for empty sets
Fixes #15019
2016-08-04 09:04:49 -04:00
Scott González
6c754b4b5b Dialog: Support deprecated button options
Fixes #15016
Closes gh-1723
2016-07-25 08:38:51 -04:00
Scott González
ea44d84975 Build: Add jQuery 3.1.0 2016-07-08 13:02:10 -04:00
Scott González
3b066697bc Tests: Only test latest patch versions for jQuery Core in TestSwarm
Adds some missing tests to TestSwarm and `all.html`.
2016-07-08 12:51:44 -04:00
Scott González
4d9779342e Resizable: Avoid Array#map() in tests for IE8 2016-07-07 10:18:18 -04:00
Scott González
92451b44c1 Tooltip: Allow tracking tooltips to be off by a fraciton of a pixel
Closes gh-1718
2016-07-07 09:16:52 -04:00
Scott González
dc8b1c8bb9 Tests: Add jQuery 3.0.0 to missing systems 2016-07-07 09:07:54 -04:00
Scott González
ba91b324ab Effects: Fix timing of .animateClass() assertion 2016-07-06 16:29:43 -04:00
Scott González
9d807ba109 Tabs: Remove test for Ajax URLs containing hashes
This hasn't been a problem for a long time and jQuery no longer removes
the hash in 3.0.0, so the test started to fail even though the actual
code is working just fine.

Ref #3627
Ref jquery/jquery#1732
2016-07-06 13:09:15 -04:00
Alexander Schmitz
71b93ed247 Build: Add jQuery 3.0 for testing 2016-07-06 09:45:29 -04:00
Gabriel Schulhof
3a9a3c7c5b Controlgroup: Correctly handle non-empty child class key
Fixes #14984
Closes gh-1713
2016-07-06 09:42:31 -04:00
Alexander Schmitz
8a79fc8784 Controlgroup: Add "only" position to class generator functions
Fixes #14972
Closes gh-1711
2016-06-09 14:10:40 -04:00
Scott González
3c860f95aa All: Replace non-breaking spaces with regular spaces 2016-06-08 13:03:42 -04:00
Alexander Schmitz
abc2a755f9 Checkboxradio: Use new ui-state-checked class in checkboxradio
Using `ui-state-highlight` caused a conflict with dialog

Fixes #14955
Closes gh-1712
Closes gh-1704
2016-06-06 11:34:52 -04:00
Peter Dave Hello
b7d0c701c7 All: Optimize png images losslessly using zopflipng
Closes gh-1710
2016-06-06 11:26:06 -04:00
Peter Kehl
ab5a18da3a Tests: Removed links to tests that no longer exist
Closes gh-1709
2016-05-31 09:58:51 -04:00
Alexander Schmitz
7d5e6d2496 Controlgroup: Fix rendering of labels
Fixes #14967
Closes gh-1703
2016-05-26 09:15:48 -04:00
Alexander Schmitz
81a8e30c07 Controlgroup: Fix issues with compatibility with spinner
Fixes #14966
2016-05-26 09:15:48 -04:00
Alexander Schmitz
04b670e6cc Controlgroup: Don't remove existing classes classes
unless its a corner class

Fixes #14960
2016-05-26 09:15:48 -04:00
Michał Gołębiowski
468f1e3abe Build: Add jQuery 1.12/2.2 to the test configuration
Ref gh-1706
2016-05-25 16:42:06 -04:00
Scott González
50d910b848 Focusable: Detect disabled fieldsets
Fixes #14970
Closes gh-1705
2016-05-25 15:32:18 -04:00
Scott González
fbc79e1bda Tabs: Fix test 2016-05-25 08:41:08 -04:00
Scott González
010f5f9d13 Tooltip: Fix re-enabling of delegated tooltips
Fixes #14950
Closes gh-1699
2016-04-21 10:59:27 -04:00
Amanpreet Singh
2e770153c5 Tests: Remove all qunit global excludes from jshint config 2016-04-14 00:29:33 +05:30
Amanpreet Singh
e568225a30 Tests: Update common lib to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
10741ef7f8 Widget: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
92f122d5b1 Tooltip: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
bfcd6358fe Tabs: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
b5028f02bf Spinner: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
749f95ee0a Sortable: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
38d473708b Slider: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
d00c5641b9 Selectmenu: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
b6392d6a6d Selectable: Shift to use no globals 2016-04-14 00:14:57 +05:30
Amanpreet Singh
611e3648b5 Resizeable: Shift to use no globals 2016-04-14 00:14:43 +05:30
Amanpreet Singh
b7b53d2163 Progressbar: Shift to use no globals 2016-04-14 00:08:29 +05:30
Amanpreet Singh
059b5b17a1 Position: Shift to use no globals 2016-04-14 00:08:29 +05:30
Amanpreet Singh
8127030ed4 Menu: Shift to use no globals 2016-04-14 00:08:28 +05:30
Amanpreet Singh
f0c8b77123 Form: Shift form-reset-mixin to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
3dd45b1ae6 Effects: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
8470b6a965 Droppable: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
46f607af97 Draggable: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
86fd11d5a7 Dialog: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
e8e8867707 Datepicker: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
20b6e976fb Core: Shift to no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
290f0e73be Controlgroup: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
e089b1dd49 Checkboxradio: Shift to use no globals 2016-04-14 00:06:12 +05:30
Amanpreet Singh
fd1c236c0f Autocomplete: Shift to use no globals 2016-04-14 00:06:11 +05:30
Amanpreet Singh
f375fd1300 Button: Shift to no globals 2016-04-14 00:06:11 +05:30
Amanpreet Singh
d83db4f528 Accordion: Shift to use no globals 2016-04-14 00:06:11 +05:30
Scott González
57f801f1de Menu: Don't reset active element until after triggering blur event
This ensures that `ui.item` actually exists in the `blur` event.

Fixes #14945
Closes gh-1696
2016-04-13 11:08:21 -04:00
Konstantin Dinev
623b64eefc Resizable: Implement setOption for handles
Fixes #3423
Closes gh-1666
2016-03-30 14:08:41 -04:00
Mukul Hase
a1905e2c5e Slider: Fixed max value miscalculation
Fixes #12852
Closes gh-1664
2016-03-30 13:28:04 -04:00