calling focus within window.onfocus broken.




12 years ago
10 years ago


(Reporter: tdys, Unassigned)


1.8 Branch

Firefox Tracking Flags

(Not tracked)




12 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

Changing focus within a focus handler doesn't work correctly. For example if you have two iframes each with an edit control. 

the container of the iframe calls frame.contentWindow.focus() to set focus to the iframe. The Iframe detects this in its window.onfocus handler and calls the edit.focus() method. Nothing happens, focus seems to be lost. If you click on another app then back to firefox the edit then has focus.

Another work around is to use a timer to delay the edit.focus call.

This may seem obscure, but when you are trying to provide proper keyboard access it is an issue.

I don't know if it matters but the top level window is a xul chrome window.

Reproducible: Always

Comment 1

12 years ago
A minimized testcase for this would be great. (You can attach the <iframe> page first, then use its URL when making the container page.)
Assignee: nobody → events
Component: Keyboard Navigation → Event Handling
Product: Firefox → Core
QA Contact: keyboard.navigation → ian
Version: unspecified → 1.8 Branch
Assignee: events → nobody
QA Contact: ian → events
You need to log in before you can comment on or make changes to this bug.