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
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Sign in to add a comment

DOM Level 3: FocusEvent sequence

Reported by, 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:

What is the expected behavior?
The sequence per DOM Level 3 [1] should be: focusout, focusin, blur, focus


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.
1.9 KB View Download

Comment 1 by, Jan 19 2015

Labels: Cr-Blink-DOM
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 
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 

80.1 KB View Download
Labels: -Cr-Blink-JavaScript -Cr-Blink-DOM Cr-Blink-Events
rponnada, "DOM events" != "JavaScript".

Comment 4 by, Feb 3 2015

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

Comment 5 by, Jul 15 2015

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

Comment 6 by, Jul 23 2015

Status: Assigned
Gary, could you confirm this?

Comment 7 by, Aug 27 2015

Components: Blink>HTML>Focus
Components: -Blink>Focus

Sign in to add a comment