aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EventContext.cpp
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-10-23 07:32:21 +0800
committerXan Lopez <xan@src.gnome.org>2003-10-23 07:32:21 +0800
commitd92e40e0fb9d3eaabb4984111887fa54b1aeb0d0 (patch)
tree79366211be635d263be5bf22e08de7c1237204ce /embed/mozilla/EventContext.cpp
parent30c4cba685f031e7b5d61ab7f86de8547d234b37 (diff)
downloadgsoc2013-epiphany-d92e40e0fb9d3eaabb4984111887fa54b1aeb0d0.tar.gz
gsoc2013-epiphany-d92e40e0fb9d3eaabb4984111887fa54b1aeb0d0.tar.zst
gsoc2013-epiphany-d92e40e0fb9d3eaabb4984111887fa54b1aeb0d0.zip
Every time you change API God kills a kitten. Think of the kitten!! (That
* embed/mozilla/EphyEventListener.cpp: * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/EphyWrapper.h: * embed/mozilla/EventContext.cpp: Every time you change API God kills a kitten. Think of the kitten!! (That means you, Mozilla :)
Diffstat (limited to 'embed/mozilla/EventContext.cpp')
-rw-r--r--embed/mozilla/EventContext.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index 8aaf2db1f..bfce49e2e 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -145,13 +145,19 @@ nsresult EventContext::GatherTextUnder (nsIDOMNode* aNode, nsString& aResult)
nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl, nsACString &url)
{
nsresult rv;
+#if MOZILLA_SNAPSHOT > 11
+ nsIURI *base;
+ base = doc->GetBaseURL ();
+ if (base == NULL) return NS_ERROR_FAILURE;
+#elif MOZILLA_SNAPSHOT > 9
nsCOMPtr<nsIURI> base;
-#if MOZILLA_SNAPSHOT > 9
rv = doc->GetBaseURL (getter_AddRefs(base));
+ if (NS_FAILED(rv)) return rv;
#else
+ nsCOMPtr<nsIURI> base;
rv = doc->GetBaseURL (*getter_AddRefs(base));
-#endif
if (NS_FAILED(rv)) return rv;
+#endif
return base->Resolve (NS_ConvertUCS2toUTF8(relurl), url);
}
@@ -159,9 +165,15 @@ nsresult EventContext::ResolveBaseURL (nsIDocument *doc, const nsAString &relurl
nsresult EventContext::ResolveDocumentURL (nsIDocument *doc, const nsAString &relurl, nsACString &url)
{
nsresult rv;
+#if MOZILLA_SNAPSHOT > 11
+ nsIURI *uri;
+ uri = doc->GetDocumentURL ();
+ if (uri == NULL) return NS_ERROR_FAILURE;
+#else
nsCOMPtr<nsIURI> uri;
rv = doc->GetDocumentURL(getter_AddRefs(uri));
if (NS_FAILED(rv)) return rv;
+#endif
return uri->Resolve (NS_ConvertUCS2toUTF8(relurl), url);
}