aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2008-02-15 18:34:48 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2008-02-15 18:34:48 +0800
commit501aee760283533703d8c8cfa23599915ff0da68 (patch)
treeb3248f76917ba524f28bdc283b7bc8c0295f48b1 /embed/mozilla
parent7411f596afe064f52e49e778f81d0e88f0b13d3c (diff)
downloadgsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar.gz
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar.bz2
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar.lz
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar.xz
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.tar.zst
gsoc2013-epiphany-501aee760283533703d8c8cfa23599915ff0da68.zip
Make Go Up recognize HTML anchors. Bug #335631.
svn path=/trunk/; revision=7946
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-embed.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index f5f600934..77d11b224 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -428,8 +428,18 @@ mozilla_embed_get_uri_parent (MozillaEmbed *membed,
nsCString encoding;
rv = membed->priv->browser->GetEncoding (encoding);
if (NS_FAILED (rv)) return FALSE;
-
+
+ /* Check for HTML anchors */
nsCOMPtr<nsIURI> uri;
+ const char *anchor = strrchr (aUri, '#');
+ if (anchor)
+ {
+ aParent.Assign (aUri);
+ aParent.SetLength (anchor - aUri);
+
+ return TRUE;
+ }
+
rv = EphyUtils::NewURI (getter_AddRefs(uri), nsCString(aUri), encoding.get());
if (NS_FAILED(rv) || !uri) return FALSE;