aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-15 06:34:43 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-15 06:34:43 +0800
commitc41a8f5a1e551116d8a1d82e0aa3246e636cc175 (patch)
tree9737a41f6c78c8fcdd4bc036b3153b628b893b19 /embed
parent367e685ae5c06b9394607c98bca9e726b63e034c (diff)
downloadgsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar.gz
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar.bz2
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar.lz
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar.xz
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.tar.zst
gsoc2013-epiphany-c41a8f5a1e551116d8a1d82e0aa3246e636cc175.zip
Work around mozilla bug #246392 which goes back to the original urls when
2004-06-15 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Work around mozilla bug #246392 which goes back to the original urls when reloading a frameset. Fixes bug #115800.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/EphyBrowser.cpp38
-rw-r--r--embed/mozilla/EphyBrowser.h6
-rw-r--r--embed/mozilla/mozilla-embed.cpp23
3 files changed, 66 insertions, 1 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 2ca36a9bb..eb86d5fd4 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -371,6 +371,44 @@ nsresult EphyBrowser::GoToHistoryIndex (PRInt16 index)
return ContentNav->GotoIndex (index);
}
+/* Workaround for broken reload with frames, see mozilla bug
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=246392
+ */
+nsresult EphyBrowser::Reload (PRUint32 flags)
+{
+ NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE);
+
+ nsCOMPtr<nsISHistory> sessionHistory;
+ GetSHistory (getter_AddRefs (sessionHistory));
+
+ nsCOMPtr<nsIWebNavigation> webNavigation;
+ webNavigation = do_QueryInterface (sessionHistory);
+
+ if (!webNavigation)
+ {
+ webNavigation = do_QueryInterface (mWebBrowser);
+ }
+ NS_ENSURE_TRUE (webNavigation, NS_ERROR_FAILURE);
+
+ PRUint32 reloadFlags;
+ switch (flags)
+ {
+ case RELOAD_FORCE:
+ reloadFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE |
+ nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
+ break;
+ case RELOAD_ENCODING_CHANGE:
+ reloadFlags = nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE;
+ break;
+ case RELOAD_NORMAL:
+ default:
+ reloadFlags = 0;
+ break;
+ }
+
+ return webNavigation->Reload (reloadFlags);
+}
+
nsresult EphyBrowser::SetZoom (float aZoom)
{
NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE);
diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h
index f2f034dd1..07023887c 100644
--- a/embed/mozilla/EphyBrowser.h
+++ b/embed/mozilla/EphyBrowser.h
@@ -100,6 +100,12 @@ public:
nsresult GetSHUrlAtIndex (PRInt32 index, nsACString &url);
nsresult GoToHistoryIndex (PRInt16 index);
+ enum { RELOAD_NORMAL = 0 };
+ enum { RELOAD_FORCE = 1 };
+ enum { RELOAD_ENCODING_CHANGE = 2 };
+
+ nsresult Reload (PRUint32 flags);
+
nsresult ForceEncoding (const char *encoding);
nsresult GetEncoding (nsACString &encoding);
nsresult GetForcedEncoding (nsACString &encoding);
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 1f4f826c1..5d7e30bc8 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -509,6 +509,12 @@ static void
impl_reload (EphyEmbed *embed,
gboolean force)
{
+ /* Workaround for broken reload with frames, see mozilla bug
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=246392
+ * Replace #if 0 with appropriate MOZILLA_CHECK_VERSION4 once the bug
+ * has been fixed
+ */
+#if 0
guint32 mflags;
mflags = GTK_MOZ_EMBED_FLAG_RELOADNORMAL;
@@ -517,8 +523,14 @@ impl_reload (EphyEmbed *embed,
{
mflags = GTK_MOZ_EMBED_FLAG_RELOADBYPASSPROXYANDCACHE;
}
-
+
gtk_moz_embed_reload (GTK_MOZ_EMBED(embed), mflags);
+#else
+ MozillaEmbedPrivate *mpriv = MOZILLA_EMBED (embed)->priv;
+
+ mpriv->browser->Reload (force ? EphyBrowser::RELOAD_FORCE :
+ EphyBrowser::RELOAD_NORMAL);
+#endif
}
static void
@@ -749,8 +761,17 @@ impl_set_encoding (EphyEmbed *embed,
if (NS_FAILED (result)) return;
}
+ /* Workaround for broken reload with frames, see mozilla bug
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=246392
+ * Replace #if 0 with appropriate MOZILLA_CHECK_VERSION4 once the bug
+ * has been fixed
+ */
+#if 0
gtk_moz_embed_reload (GTK_MOZ_EMBED (embed),
GTK_MOZ_EMBED_FLAG_RELOADCHARSETCHANGE);
+#else
+ mpriv->browser->Reload (EphyBrowser::RELOAD_ENCODING_CHANGE);
+#endif
}
static char *