Created attachment 244864 [details] focus-event-sequence.html # Steps to reproduce the problem: 1. register event listeners for focusout, blur, focusin, focus 2. observe sequence of dispatched events upon shifting focus Live test-case: http://medialize.github.io/ally.js/tests/browser-bugs/focus-event-order.html # What is the expected behavior? The sequence per DOM Level 3 [1] should be: focusout, focusin, blur, focus [1] https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#events-focusevent-event-order # What went wrong? sequence is blur, focusout, focus, focusing With the currently provided sequence the focusout and focusin events cannot be safely used to alter focus before it was given. The only "benefit" the current implementation brings with focusin over focus is that the former bubbles, the latter does not. Gecko doesn't support focusin/focusout at all. WebKit suffers the same bug. IE11 dispatches focus events asynchronously thereby accidentally getting the sequence right, IE12 Win10 Tec Preview fixed the ansynchronous-bug and thereby messed up the sequence as well. Chromium bug for reference: https://code.google.com/p/chromium/issues/detail?id=449857
Another testcase: http://w3c-test.org/uievents/order-of-events/focus-events/focus-manual.html
We pass following WPT tests - https://wpt.fyi/results/uievents/order-of-events/focus-events/focus-automated-blink-webkit.html?label=master&label=experimental&aligned&view=subtest&q=focus-event Which are in relation to "order of event" similar to Comment 01. I am going to mark this as "RESOLVED CONFIGURATION CHANGED", since we are passing related WPT tests. Please reopen, if I am wrong. Thanks!