New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 449857 link

Starred by 9 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

DOM Level 3: FocusEvent sequence

Reported by rodneyr...@gmail.com, Jan 18 2015

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2278.0 Safari/537.36

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, focusin

Did this work before? No 

Chrome version: 42.0.2278.0  Channel: canary
OS Version: OS X 10.8.5
Flash Version: Shockwave Flash 16.0 r0

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.
 
focus-event-sequence.html
1.9 KB View Download

Comment 1 by meh...@chromium.org, Jan 19 2015

Labels: Cr-Blink-DOM
Cc: kbr@chromium.org jkummerow@chromium.org
Labels: -OS-Mac OS-All M-42
Status: Untriaged
Able to reproduce this issue on Windows7 using:41.0.2272.12 & 42.0.2283.5 canary with below steps:

1. Opened focus-event-sequence.html 
Observed 
focusing #first for context, #second in 500ms
focusing #second
blur (target: first, relatedTarget: second)
focusout (target: first, relatedTarget: second)
focus (target: second, relatedTarget: first)
focusin (target: second, relatedTarget: first

This is non-regression issue, same behaviour is observed from M28:28.0.1455.0 

449857.png
80.1 KB View Download
Cc: -jkummerow@chromium.org -kbr@chromium.org
Labels: -Cr-Blink-JavaScript -Cr-Blink-DOM Cr-Blink-Events
Owner: rponnada@chromium.org
rponnada, "DOM events" != "JavaScript".

Comment 4 by tkent@chromium.org, Feb 3 2015

Labels: -M-42
Owner: ----

Comment 5 by tkent@chromium.org, Jul 15 2015

Labels: -Cr-Blink-Events Cr-Blink-Focus

Comment 6 by kochi@chromium.org, Jul 23 2015

Cc: kochi@chromium.org
Owner: garykac@chromium.org
Status: Assigned
Gary, could you confirm this?

Comment 7 by kochi@chromium.org, Aug 27 2015

Ping?
Components: Blink>HTML>Focus
Components: -Blink>Focus

Sign in to add a comment