Bug 14834 - Assigning programmatic focus to non-form elements does not fire focus/blur event
Summary: Assigning programmatic focus to non-form elements does not fire focus/blur event
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 12:09 PDT by Benjamin Listwon
Modified: 2007-07-31 14:17 PDT (History)
0 users

See Also:


Attachments
A test web page to demonstrate lack of focus/blur events. (826 bytes, text/html)
2007-07-31 12:10 PDT, Benjamin Listwon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.