jquery/jquery — comment on commit 006fde228da59ae71c11a67ef65dbfc09e788773
File:  line 0
By mikesherov:

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 the `setTimeout` in `supportIFrameTest` to something like `100` instead of `0`, 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 an `alert('hi!');` after `window.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.