summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2007-03-15 15:15:40 +0000
committerGrant Gayed <ggayed>2007-03-15 15:15:40 +0000
commitc2c8934388f1a5373cba0d0285144058a8b19928 (patch)
treee9222c7f2a305527e744ada9ed1b1eb5f41134d6
parent6792575e9ebdb961dabdb7dc271f66f85beb9c8c (diff)
downloadeclipse.platform.swt-c2c8934388f1a5373cba0d0285144058a8b19928.tar.gz
eclipse.platform.swt-c2c8934388f1a5373cba0d0285144058a8b19928.tar.xz
eclipse.platform.swt-c2c8934388f1a5373cba0d0285144058a8b19928.zip
fix junit test case
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
index b4bcb38ebf..270f3bb625 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
@@ -1391,12 +1391,12 @@ public boolean setText (String html) {
}
/*
- * Feature of Mozilla. Setting the browser's content from a stream does not
+ * Feature of XULRunner. Setting the browser's content from a stream does not
* fire a DOM "unload" event for the previous page, which is the event that
* is used to unhook registered DOM listeners. As a workaround, unhook them
* now before setting the new page content.
*/
- unhookDOMListeners ();
+ if (IsXULRunner) unhookDOMListeners ();
int /*long*/[] result = new int /*long*/[1];
int rc = XPCOM.NS_GetServiceManager (result);
@@ -1494,7 +1494,13 @@ public boolean setText (String html) {
XPCOM.nsEmbedCString_delete (aContentType);
uri.Release ();
- hookDOMListeners ();
+
+ /*
+ * Feature of XULRunner. Setting the browser's content from a stream does not
+ * lead to nsIWebProgressListener.OnStateChange being called with STATE_TRANSFERRING,
+ * which is the event that is used to hook DOM listeners, so hook them here.
+ */
+ if (IsXULRunner) hookDOMListeners ();
return true;
}