When we are waiting for the body to load, we do look for that event.
https://s/?fileprint=//depot/google3/third_party/java_src/gwt/svn/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js

The problem is that late loaded apps will never see that event (as I
understand it) since their bootstrap code executes well after that event
(late loaded apps are those that we bootstrap by appending a script tag with
the nocache.js to an already loaded page). Therefore, we need them to
correctly receive "true" for isBodyLoaded().  Actually, we run into problems
before that since there are places in the code where we do doc.write() if
the body is not loaded.  Long story short - is BodyLoaded() has to return
true/false, not wait for it to become true.

There was no good way I could think of to definitively tell if the body is
fully loaded, but we got lucky.  The only case that is ambiguous (<FF3.5) is
also a case which allows you to append script tags before the body is fully
loaded. So - we changed isBodyLoaded() to check (in that case only) for
whether the body exists:
https://s/?change_num=18053214

This worked fine in my test app, but for some reason, in some cases (I
haven't fully groked which ones) the body is defined, but null. That's the
issue I'm fixing here.

- Unnur



On Mon, Nov 15, 2010 at 5:46 PM, <[email protected]> wrote:

>
> http://gwt-code-reviews.appspot.com/1111801/diff/1/2
> File dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js
> (right):
>
> http://gwt-code-reviews.appspot.com/1111801/diff/1/2#newcode30
> dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js:30:
>
> return (typeof $doc.body != "undefined" && $doc.body != null);
> have we considered trying to use the DOMContentLoaded event instead?
>
>
> http://gwt-code-reviews.appspot.com/1111801/show
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to