xsiframe linker generated code should execute immediately if injected after the DOM ready event

47 views
Skip to first unread message

Tal Shani

unread,
Sep 11, 2014, 4:50:34 PM9/11/14
to google-web-tool...@googlegroups.com
Hi,

I have a GWT generated JS code that is injected to the page after the DOMReady event. I use the xsiframe linker.
After some research I discovered that the linker does listen to the DOMReady event but check for load state as fallback.
These are the relevant files:

https://gwt.googlesource.com/gwt/+/master/dev/core/src/com/google/gwt/core/ext/linker/impl/waitForBodyLoaded.js

https://gwt.googlesource.com/gwt/+/master/dev/core/src/com/google/gwt/core/ext/linker/impl/isBodyLoaded.js

So logically, we wait for the DOMready by listeneing in waitForBodyLoaded.js:
$doc.addEventListener("DOMContentLoaded", onBodyDone, false);

but we wait for the loaded state in isBodyLoaded.js:
return (/loaded|complete/.test($doc.readyState));

I can simply override the linker and replace the isBodyLoaded, but i was wondering if there is a reason why there is no "interactive" in the regex like so:
return (/loaded|complete|interactive/.test($doc.readyState));

or maybe this use case was just missed?!

Reply all
Reply to author
Forward
0 new messages