jquery/test/unit
Michał Gołębiowski-Owczarek 59f7b55bf6
Event: Simulate focus/blur in IE via focusin/focusout (3.x version)
In IE (all versions), `focus` & `blur` handlers are fired asynchronously
but `focusin` & `focusout` are run synchronously. In other browsers, all
those handlers are fired synchronously. Asynchronous behavior of these
handlers in IE caused issues for IE (gh-4856, gh-4859).

We now simulate `focus` via `focusin` & `blur` via `focusout` in IE to avoid
these issues. This also let us simplify some tests.

This commit also simplifies `leverageNative` - with IE now using `focusin`
to simulate `focus` and `focusout` to simulate `blur`, we don't have to deal
with async events in `leverageNative`. This also fixes broken `focus` triggers
after first triggering it on a hidden element - previously, `leverageNative`
assumed that the native `focus` handler not firing after calling the native 
`focus` method meant it would be handled later, asynchronously, which
was not the case (gh-4950).

To preserve relative `focusin`/`focus` & `focusout`/`blur` event order
guaranteed on the 3.x branch, attach a single handler for both events in IE.

A side effect of this is that to reduce size the `event/focusin` module
no longer exists and it's impossible to disable the `focusin` patch
in modern browsers via the jQuery custom build system.

Fixes gh-4856
Fixes gh-4859
Fixes gh-4950
Ref gh-5223
Closes gh-5224

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2023-03-27 21:24:42 +02:00
..
ajax.js Tests: Add tests for arary data in ajax 2023-03-21 00:36:51 +01:00
animation.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
attributes.js Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
basic.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
callbacks.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
core.js Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
css.js Tests: Fix selector tests in Chrome 2023-01-24 11:51:57 +01:00
data.js Docs: Replace #NUMBER Trac issue references with trac-NUMBER 2022-01-12 23:23:10 +01:00
deferred.js Tests: Skip jQuery.Deferred.exceptionHook tests in IE 9 2023-03-15 12:21:54 +01:00
deprecated.js Tests: Skip jQuery.Deferred.exceptionHook tests in IE 9 2023-03-15 12:21:54 +01:00
dimensions.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
effects.js Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
event.js Event: Simulate focus/blur in IE via focusin/focusout (3.x version) 2023-03-27 21:24:42 +02:00
exports.js Build: Update test code for compatibility with QUnit 2.x (#4297) 2019-02-18 19:03:26 +01:00
manipulation.js Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
offset.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
queue.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
ready.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
selector.js Tests: Fix selector tests in Chrome 2023-01-24 11:51:57 +01:00
serialize.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
support.js Event: Simulate focus/blur in IE via focusin/focusout (3.x version) 2023-03-27 21:24:42 +02:00
traversing.js Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
tween.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00
wrap.js Tests: Exclude tests based on compilation flags, not API presence (3.x version) 2022-07-12 17:12:27 +02:00