Reviewers: Lex, scottb,

Message:
I also should have removed the HTML wrapper generation in
IFrameLinker.java earlier. It seems to work fine everywhere, but it
doesn't really make sense to document.write() <html>, <head>, and <body>
tags.


http://gwt-code-reviews.appspot.com/33847/diff/1/3
File dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js (right):

http://gwt-code-reviews.appspot.com/33847/diff/1/3#newcode356
Line 356: gwtFrameCreated = true;
It's important to note that no exception is thrown at all, afaict. But
the doc.write() works fine. I also removed the maybeStartModule()
because it is called from onScriptLoad(), which is in turn called from
the compiled script. So this one was redundant.



Please review this at http://gwt-code-reviews.appspot.com/33847

Affected files:
   M     dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
   M     dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js


Index: dev/core/src/com/google/gwt/core/linker/IFrameLinker.java
===================================================================
--- dev/core/src/com/google/gwt/core/linker/IFrameLinker.java   (revision  
5528)
+++ dev/core/src/com/google/gwt/core/linker/IFrameLinker.java   (working copy)
@@ -208,7 +208,7 @@
      out.print("if ($wnd." + context.getModuleFunctionName() + ") $wnd."
          + context.getModuleFunctionName() + ".onScriptLoad();");
      out.newline();
-    out.print("--></script></body></html>");
+    out.print("--></script>");
      out.newlineOpt();

      return out.toString();
@@ -249,11 +249,10 @@
    private String getModulePrefix(LinkerContext context, String strongName,
        boolean supportRunAsync) {
      DefaultTextOutput out = new  
DefaultTextOutput(context.isOutputCompact());
-    out.print("<html>");
      out.newlineOpt();

      // Setup the well-known variables.
-    out.print("<head><script>");
+    out.print("<script>");
      out.newlineOpt();
      out.print("var $gwt_version = \"" + About.getGwtVersionNum() + "\";");
      out.newlineOpt();
@@ -306,9 +305,8 @@
          + "',subSystem:'startup',evtGroup:'moduleStartup'"
          + ",millis:(new Date()).getTime(),type:'moduleEvalStart'});");
      out.newlineOpt();
-    out.print("</script></head>");
+    out.print("</script>");
      out.newlineOpt();
-    out.print("<body>");
      out.newlineOpt();

      // Begin a script block inside the body. It's commented out so that the
Index: dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
===================================================================
--- dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js   (revision  
5528)
+++ dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js   (working copy)
@@ -350,14 +350,17 @@
          win.name = '__MODULE_NAME__';
        }

+      // Set this *before* calling doc.write(), because the linux  
hosted-mode
+      // browser sometimes doesn't properly return from doc.write() if  
there are
+      // a large number of script blocks (even though it works fine). Go  
figure.
+      gwtFrameCreated = true;
+
        // Inject the fetched script into the script frame.
        // (this script will call onScriptLoad())
        var doc = win.document;
        doc.open();
        doc.write(compiledScript);
        doc.close();
-      gwtFrameCreated = true;
-      maybeStartModule();
      }
    }




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

Reply via email to