Closed Bug 901835 Opened 12 years ago Closed 12 years ago

Focus event is not triggered when window is inactive

Categories

(Core :: DOM: Core & HTML, defect)

22 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 566671

People

(Reporter: johannes.odland, Unassigned)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3) Steps to reproduce: Programatically focused element using element.focus(). Expected focus event to be triggered on element. This can be tested through this jsfiddle: http://jsfiddle.net/mrodland/wXX7P/12/ Actual results: When the window is inactive, the focus event is not triggered. Expected results: Focus event is triggered on element, even when window is inactive. This is the behavior in all other tested browsers (Chrome, Safari, IE).
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Attached file 901835.html (testcase)
I got a different result with your testcase attached to the bug ("focus event" is always fired and follows the "active element"). Could you confirm or not, please.
Flags: needinfo?(johannes.odland)
Recently tested on Windows 7, Ubuntu and OSX. Open the attachment in one window. The element is set active and the focus event is triggered. Open another window and keep it side by side with the one containing the attachmend. As long as the new window is active, the focus event is not triggered, but the activeElement is updated. Set focus on the window with the attachment and the focus event starts triggering again.
Flags: needinfo?(johannes.odland)
I believe this is purposeful: focus is global, so things that are focused in non-active windows don't actually get focus until that window itself gets focus. Neil?
Flags: needinfo?(enndeakin)
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Flags: needinfo?(enndeakin)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: