Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass iframe support tests at doc ready. Fixes support fail in FF7
- Loading branch information
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
006fde2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I actually sorta figured out why FF7 complains and Chrome doesn't, and Opera does sometimes before this change.
It seems as if Firefox lets 2 windows run javascript independent of each other (as expected?). By the time the
window.supportCallback
actually runs in FF7, there is no gaurantee the support tests ran in the IFRAME yet. If you change thesetTimeout
insupportIFrameTest
to something like100
instead of0
, FF complains a lot less often. It's a race.It seems as if it's the same situation in Opera, however Opera seems like the
document.ready
on the iframe fires early enough to never complain. It's still a race, but the IFRAME always wins. If you want the IFRAME to lose, just put analert('hi!');
afterwindow.parent.supportCallback( jQuery( "body" ).css( "backgroundColor" ), jQuery.support );
and you'll see that the IFRAME now loses because the alert stops execution on that IFRAME.For Chrome, different story. It seems as if Chrome finishes executing all the code in the IFRAME (including doc ready ?) before executing the callback on the parent window. To demonstrate, go ahead and and put that same alert in. If you notice, if you close the alert after 4 seconds, it's four more seconds before the test finishing running. It's as if the alert stops JS execution on both windows!
Weird.