Open Bug 1272328 Opened 5 years ago Updated 1 year ago
Autofocus doesn't work in iframe after navigation
When an iframe is first loaded together with its enclosing page, the "autofocus" attribute on inputs inside the iframe works as expected. However if the iframe is navigated to a new page, "autofocus" on an element in this new page is ignored. I am attaching a .zip containing three html files, which need to be placed in the same location (local or server folder): test1.html - the enclosing page containing the iframe test2.html - the initial iframe contents, containing an autofocus field and a navigation button leading to test3.html test3.html - another page containing an autofocus input field Navigate to test2.html: Observe the auto-focussed input field. Now click the button. Observer that the new page also has an auto-focussed input field. This is the expected behaviour. Now do the same thing, but by opening test1.html. This just displays test2.html inside a red-bordered iframe. Note that the initial autofocus field works, but after the button is clicked, no element is auto-focussed on the new page that loads inside the iframe. This clearly seems like a bug. It's as if autofocus is only applied when the top-level browsing context is navigated, even though the attribute occurs in an iframe; it should be applied to pages inside iframes whenever those iframes are navigated, surely?
You need to log in before you can comment on or make changes to this bug.