What steps will reproduce the problem?
(1) With --site-per-process enabled, navigate to http://csreis.github.io/tests/cross-site-iframe-simple.html
(2) Using devtools, run the following JS in the IFRAME context:
document.head.innerHTML = '';
document.body.innerHTML = '<input id="text1"> <input id="text2">';
text1.focus();
document.body.addEventListener('focus', (e) => { console.log('got focus event on', e.target) }, true);
(3) Using devtools, run the following JS in the TOP context:
let dialog = document.body.appendChild(document.createElement('dialog'));
dialog.innerHTML = "This is a modal dialog. <input>";
dialog.showModal();
(4) Using devtools, run the following JS in the IFRAME context:
window.setTimeout(() => { console.log('about to focus', text2); text2.focus(); }, 5000);
(5) IMMEDIATELY move focus to the main browser window (via Alt+Tab or using the mouse to click on the window top bar avoiding clicking on any focusable items).
What is the expected result?
- The <input> in the modal dialog is shown as focus when the browser window is focused, and remains focused even after the timeout causes the log statement to be printed.
- No 'got focus event on' log statement should be printed.
(This can be verified by running these steps without --site-per-process enabled.)
What happens instead?
- After the timeout finishes, "got focus event on <input id="text2">…</input>" is logged as a result of the focus() call.
Comment 1 by kenrb@chromium.org
, May 9 2017