Bug 1709125 Comment 39 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

         info("must wait for focus");
-        childDesiredWindow.addEventListener("focus", focusedOrLoaded, true);
-        if (isChildProcess) {
-          childDesiredWindow.focus();
-        } else {
-          SpecialPowers.focus(childDesiredWindow);
-        }
+        desiredWindow.focus();

You would still need to listen for the focus event on the expected child iframe. I tried re-adding the event listener and ran the first failed test above ( docshell/test/navigation/test_bug430624.html) and the test passed again.
 
 That said, I would expect that the original code could just call desiredWindow.focus() instead of childDesiredWindow.focus().
         info("must wait for focus");
\-        childDesiredWindow.addEventListener("focus", focusedOrLoaded, true);
\-        if (isChildProcess) {
\-          childDesiredWindow.focus();
\-        } else {
\-          SpecialPowers.focus(childDesiredWindow);
\-        }
\+        desiredWindow.focus();

You would still need to listen for the focus event on the expected child iframe. I tried re-adding the event listener and ran the first failed test above ( docshell/test/navigation/test_bug430624.html) and the test passed again.
 
 That said, I would expect that the original code could just call desiredWindow.focus() instead of childDesiredWindow.focus().
\-        childDesiredWindow.addEventListener("focus", focusedOrLoaded, true);
\-        if (isChildProcess) {
\-          childDesiredWindow.focus();
\-        } else {
\-          SpecialPowers.focus(childDesiredWindow);
\-        }
\+        desiredWindow.focus();

You would still need to listen for the focus event on the expected child iframe. I tried re-adding the event listener and ran the first failed test above ( docshell/test/navigation/test_bug430624.html) and the test passed again.
 
 That said, I would expect that the original code could just call desiredWindow.focus() instead of childDesiredWindow.focus().

Back to Bug 1709125 Comment 39