jquery/test
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
..
data Selector: Inline Sizzle into the selector module: 3.x version (#5113) 2022-12-14 01:41:31 +01:00
integration Event: Fix delegated radio events when arrow keys are used 2015-10-18 13:06:37 -04:00
node_smoke_tests Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test 2019-03-04 18:30:51 +01:00
promises_aplus_adapters Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test 2019-03-04 18:30:51 +01:00
unit Event: Simulate focus/blur in IE via focusin/focusout (3.x version) 2023-03-27 21:24:42 +02:00
.eslintrc.json Build: Migrate middleware-mockserver to modern JS 2023-01-23 23:30:08 +01:00
delegatetest.html Tests: Change quotes according to style guidelines 2015-10-18 13:17:23 -04:00
hovertest.html Ref #13316: Sync all documents on full vs. minified source. Close gh-1147. 2013-02-07 15:16:28 -05:00
index.html Build: Make Karma work in AMD mode 2020-01-21 13:26:47 +01:00
jquery.js Build: Make Karma work in AMD mode 2020-01-21 13:26:47 +01:00
karma.context.html Build: Make Karma work in AMD mode 2020-01-21 13:26:47 +01:00
karma.debug.html Build: Make Karma work in AMD mode 2020-01-21 13:26:47 +01:00
localfile.html Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:59:49 +01:00
middleware-mockserver.js Build: Migrate middleware-mockserver to modern JS 2023-01-23 23:30:08 +01:00
networkerror.html Docs: Replace #NUMBER Trac issue references with trac-NUMBER 2022-01-12 23:23:10 +01:00
xhtml.php Added a way to run the test suite as an XHTML page. 2009-01-19 18:14:51 +00:00