Fixes Issue #1504.
Regression of issue #1235. Now sets src on the code iframe after it is
attached to the DOM.
Review by: jgw
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1323 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
index 088ec4a..c6cfc2d 100644
--- a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
+++ b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
@@ -130,7 +130,7 @@
var loc = $doc.location;
var href = loc.href;
base = getDirectoryOfFile(href.substr(0, href.length
- - loc.hash.length));
+ - loc.hash.length));
}
} else if ((base.match(/^\w+:\/\//))) {
// If the URL is obviously absolute, do nothing.
@@ -346,10 +346,15 @@
scriptInjected = true;
var iframe = $doc.createElement('iframe');
iframe.id = "__MODULE_NAME__";
- iframe.src = base + strongName;
iframe.style.cssText = "position:absolute;width:0;height:0;border:none";
// Due to an IE6/7 refresh quirk, this must be an appendChild.
$doc.body.appendChild(iframe);
+
+ /*
+ * The src has to be set after the iframe is attached to the DOM to avoid
+ * refresh quirks in Safari.
+ */
+ iframe.src = base + strongName;
}
}