Modify the SSSS Direct install linker to install code in the main window rather than just
letting it execute because we have no guarantee that the doc is loaded and teams are
seeing doc not defined errors if they include the script in the head.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9212 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
index 44226d3..7212b61 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
@@ -7,11 +7,6 @@
// The items that must be provided in any install location are:
// $wnd - the location where the bootstrap module is defined. Should also
// be the location where the __gwtStatsEvent is defined
-//
-// For hosted mode to work, the following must also be provided. Note that if
-// the hosted.js file went through the same processing as the md5.js files,
-// these additional variables would not be needed.
-// __gwt_moduleFunction
var frameDoc;
@@ -19,7 +14,7 @@
setupInstallLocation();
return frameDoc;
}
-
+
function getInstallLocation() {
setupInstallLocation();
return frameDoc.getElementsByTagName('body')[0];
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js
new file mode 100644
index 0000000..134f0b1
--- /dev/null
+++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js
@@ -0,0 +1,30 @@
+// The GWT code can be installed anywhere, although an iFrame is the best
+// approach if you want both variable isolation (useful in general, but
+// critical if you want more than one GWT module on your page) and runAsync
+// which will need to be able to install additional chunks of code into that
+// isolated environment later on.
+
+// The items that must be provided in any install location are:
+// $wnd - the location where the bootstrap module is defined. Should also
+// be the location where the __gwtStatsEvent is defined
+
+var init = false;
+
+function getInstallLocationDoc() {
+ setupInstallLocation();
+ return window.document;
+}
+
+function getInstallLocation() {
+ setupInstallLocation();
+ return window.document.body;
+}
+
+function setupInstallLocation() {
+ if (init) { return; }
+ var script = window.document.createElement('script');
+ script.language='javascript';
+ script.text = "var $wnd = window;";
+ window.document.body.appendChild(script);
+ init = true;
+}
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptNull.js b/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptNull.js
deleted file mode 100644
index 382e34a..0000000
--- a/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptNull.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Assumes that the script contents are directly part of the bootstrap script
-// and do not need to be installed anywhere.
-function installScript(filename) {
- // Does nothing
-}