From 22066bd3704ec0ec674ca0a9dc1ed0df35124f42 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Sun, 4 Jul 1999 23:48:06 +0000 Subject: [PATCH] Don't use the values returned by NS_MakeAbsURL to pass it to link handler, when a mailto: url is clicked. This is because netlib doesn't understand mailto: urls yet. This will be fixed the right way after NECKO lands --- content/base/src/nsGenericElement.cpp | 9 +++++++++ layout/base/src/nsGenericElement.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 458171a2b9a..7348c02b2d1 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -1239,6 +1239,15 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext, absURLSpec = aURLSpec; } + // HACK HACK HACK. If the link clicked is a mailto: url just + // pass the aURLSpec. This is because, netlib doesn't recognize + // mailto: protocol. Note: This s'd go away after NECKO lands + + PRInt32 offset = -1; + offset = aURLSpec.Find("mailto"); + if (offset >= 0) + absURLSpec = aURLSpec; + // Now pass on absolute url to the click handler if (aClick) { handler->OnLinkClick(mContent, aVerb, absURLSpec.GetUnicode(), aTargetSpec.GetUnicode()); diff --git a/layout/base/src/nsGenericElement.cpp b/layout/base/src/nsGenericElement.cpp index 458171a2b9a..7348c02b2d1 100644 --- a/layout/base/src/nsGenericElement.cpp +++ b/layout/base/src/nsGenericElement.cpp @@ -1239,6 +1239,15 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext, absURLSpec = aURLSpec; } + // HACK HACK HACK. If the link clicked is a mailto: url just + // pass the aURLSpec. This is because, netlib doesn't recognize + // mailto: protocol. Note: This s'd go away after NECKO lands + + PRInt32 offset = -1; + offset = aURLSpec.Find("mailto"); + if (offset >= 0) + absURLSpec = aURLSpec; + // Now pass on absolute url to the click handler if (aClick) { handler->OnLinkClick(mContent, aVerb, absURLSpec.GetUnicode(), aTargetSpec.GetUnicode());