Focusing on iframe fails in certain event listeners

UNCONFIRMED
Unassigned

Status

()

Core
DOM: Events
UNCONFIRMED
2 years ago
2 years ago

People

(Reporter: ccd0, Unassigned)

Tracking

42 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux i686; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151029151421

Steps to reproduce:

Attempt to set focus on an iframe via its focus() method from within an event listener (here, keydown).

Test case here:
http://jsfiddle.net/120ys896/1/


Actual results:

Pressing "1", which calls focus() from within the event handler, fails to focus on the iframe.  Pressing "2", which uses a setTimeout hack, succeeds in changing focus.



Expected results:

Both "1" and "2" should move focus from the body to the iframe.

Comment 1

2 years ago
Created attachment 8690371 [details]
1226835.html (testcase)

Updated

2 years ago
Component: Untriaged → DOM: Events
Product: Firefox → Core
(Reporter)

Comment 2

2 years ago
Created attachment 8690496 [details]
test case, URL changed to https://example.com/

The attachment version of the test case isn't working because the iframe at http://example.com/ won't load from https://bug1226835.bmoattachments.org/, and apparently the bug doesn't happen if the iframe doesn't load.  I've changed the URL to https://example.com/.

Updated

2 years ago
Attachment #8690371 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.