Bug 14834

Summary: Assigning programmatic focus to non-form elements does not fire focus/blur event
Product: WebKit Reporter: Benjamin Listwon <ben>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
A test web page to demonstrate lack of focus/blur events. none

Description Benjamin Listwon 2007-07-31 12:09:03 PDT
When javascript is used to programatically set the focus to a dom element that is not a form element, no focus event fires. Likewise (and presumably because no focus fires) the blur even will not fire when focus is transferred away.

This works in previous Safari/WebKit versions, and is a cornerstone of programming controls, such as a date picker, that allow the user to navigate DOM elements via the keyboard.

The accompanying test file can be run in 522.12 which will fail, and in previous WebKit (Safari 2) versions, as well as FireFox, to see the desired behavior.
Comment 1 Benjamin Listwon 2007-07-31 12:10:25 PDT
Created attachment 15762 [details]
A test web page to demonstrate lack of focus/blur events.

See original bug filing for places to use test file.
Comment 2 Alexey Proskuryakov 2007-07-31 13:29:09 PDT
FWIW, I'm getting identical results from r24761 nightly and from shipping Safari/WebKit. Probably I'm doing something wrong - could you please give more detailed steps to reproduce?
Comment 3 Benjamin Listwon 2007-07-31 14:17:16 PDT
You are right, this test case produces same result in nightly, 512 and 419. I'll close it for now, and if I can develop a significant test case, I will reopen with such.