Make nsILinkHandler take uris instead of strings. Bug 176904, r=darin, sr=jst
git-svn-id: svn://10.0.0.236/trunk@134133 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b6ab710264
commit
f6b3b3afb9
@ -3128,55 +3128,61 @@ nsGenericElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
nsresult
|
||||
nsGenericElement::LeaveLink(nsIPresContext* aPresContext)
|
||||
{
|
||||
nsCOMPtr<nsILinkHandler> handler;
|
||||
nsresult rv = aPresContext->GetLinkHandler(getter_AddRefs(handler));
|
||||
if (NS_FAILED(rv) || (nsnull == handler)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
return handler->OnLeaveLink();
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericElement::TriggerLink(nsIPresContext* aPresContext,
|
||||
nsLinkVerb aVerb,
|
||||
nsIURI* aBaseURL,
|
||||
const nsString& aURLSpec,
|
||||
const nsString& aTargetSpec,
|
||||
const nsAString& aURLSpec,
|
||||
const nsAFlatString& aTargetSpec,
|
||||
PRBool aClick)
|
||||
{
|
||||
nsCOMPtr<nsILinkHandler> handler;
|
||||
nsresult rv = aPresContext->GetLinkHandler(getter_AddRefs(handler));
|
||||
if (NS_FAILED(rv) || (nsnull == handler)) return rv;
|
||||
if (NS_FAILED(rv) || !handler) return rv;
|
||||
|
||||
// Resolve url to an absolute url
|
||||
nsAutoString absURLSpec;
|
||||
if (nsnull != aBaseURL) {
|
||||
rv = NS_MakeAbsoluteURI(absURLSpec, aURLSpec, aBaseURL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> targetURI;
|
||||
nsAutoString docCharset;
|
||||
if (mDocument &&
|
||||
NS_SUCCEEDED(mDocument->GetDocumentCharacterSet(docCharset))) {
|
||||
rv = NS_NewURI(getter_AddRefs(targetURI), aURLSpec,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(), aBaseURL);
|
||||
} else {
|
||||
absURLSpec.Assign(aURLSpec);
|
||||
rv = NS_NewURI(getter_AddRefs(targetURI), aURLSpec, nsnull, aBaseURL);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Now pass on absolute url to the click handler
|
||||
if (aClick) {
|
||||
nsresult proceed = NS_OK;
|
||||
// Check that this page is allowed to load this URI.
|
||||
nsCOMPtr<nsIScriptSecurityManager> securityManager =
|
||||
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIURI> absURI;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString docCharset;
|
||||
if (mDocument &&
|
||||
NS_SUCCEEDED(mDocument->GetDocumentCharacterSet(docCharset))) {
|
||||
rv = NS_NewURI(getter_AddRefs(absURI), absURLSpec,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(), aBaseURL);
|
||||
} else {
|
||||
rv = NS_NewURI(getter_AddRefs(absURI), absURLSpec, nsnull, aBaseURL);
|
||||
}
|
||||
}
|
||||
if (NS_SUCCEEDED(rv))
|
||||
proceed = securityManager->CheckLoadURI(aBaseURL, absURI, nsIScriptSecurityManager::STANDARD);
|
||||
proceed =
|
||||
securityManager->CheckLoadURI(aBaseURL, targetURI,
|
||||
nsIScriptSecurityManager::STANDARD);
|
||||
|
||||
// Only pass off the click event if the script security manager
|
||||
// says it's ok.
|
||||
if (NS_SUCCEEDED(proceed))
|
||||
handler->OnLinkClick(this, aVerb, absURLSpec.get(),
|
||||
handler->OnLinkClick(this, aVerb, targetURI,
|
||||
aTargetSpec.get());
|
||||
} else {
|
||||
handler->OnOverLink(this, absURLSpec.get(),
|
||||
handler->OnOverLink(this, targetURI,
|
||||
aTargetSpec.get());
|
||||
}
|
||||
return rv;
|
||||
|
||||
@ -537,9 +537,13 @@ public:
|
||||
nsresult TriggerLink(nsIPresContext* aPresContext,
|
||||
nsLinkVerb aVerb,
|
||||
nsIURI* aBaseURL,
|
||||
const nsString& aURLSpec,
|
||||
const nsString& aTargetSpec,
|
||||
const nsAString& aURLSpec,
|
||||
const nsAFlatString& aTargetSpec,
|
||||
PRBool aClick);
|
||||
/**
|
||||
* Do whatever needs to be done when the mouse leaves a link
|
||||
*/
|
||||
nsresult LeaveLink(nsIPresContext* aPresContext);
|
||||
|
||||
/**
|
||||
* Take two text nodes and append the second to the first.
|
||||
|
||||
@ -1238,11 +1238,8 @@ nsFormSubmission::SubmitTo(nsIURI* aActionURL, const nsAString& aTarget,
|
||||
aPresContext->GetLinkHandler(getter_AddRefs(handler));
|
||||
NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);
|
||||
|
||||
nsCAutoString actionURLSpec;
|
||||
aActionURL->GetSpec(actionURLSpec);
|
||||
|
||||
return handler->OnLinkClickSync(aSource, eLinkVerb_Replace,
|
||||
NS_ConvertUTF8toUCS2(actionURLSpec).get(),
|
||||
aActionURL,
|
||||
PromiseFlatString(aTarget).get(),
|
||||
postDataStream, nsnull,
|
||||
aDocShell, aRequest);
|
||||
|
||||
@ -1547,10 +1547,7 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter,
|
||||
case NS_MOUSE_EXIT_SYNTH:
|
||||
{
|
||||
*aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
|
||||
nsAutoString empty;
|
||||
ret = TriggerLink(aPresContext, eLinkVerb_Replace, nsnull, empty,
|
||||
empty, PR_FALSE);
|
||||
ret = LeaveLink(aPresContext);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@ -499,7 +499,8 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
|
||||
nsCOMPtr<nsIPresContext> pc;
|
||||
rv = WebShellToPresContext(aShell,getter_AddRefs(pc));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = TriggerLink(pc, verb, base, value, nsAutoString(), PR_TRUE);
|
||||
rv = TriggerLink(pc, verb, base, value,
|
||||
NS_LITERAL_STRING(""), PR_TRUE);
|
||||
|
||||
return SpecialAutoLoadReturn(rv,verb);
|
||||
}
|
||||
@ -643,9 +644,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
// XXX this doesn't seem to do anything yet
|
||||
case NS_MOUSE_EXIT_SYNTH:
|
||||
{
|
||||
nsAutoString empty;
|
||||
ret = TriggerLink(aPresContext, eLinkVerb_Replace, nsnull, empty,
|
||||
empty, PR_FALSE);
|
||||
ret = LeaveLink(aPresContext);
|
||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2424,10 +2424,9 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
|
||||
getter_AddRefs(uri));
|
||||
}
|
||||
|
||||
if (NS_ERROR_UNKNOWN_PROTOCOL == rv ||
|
||||
NS_ERROR_MALFORMED_URI == rv) {
|
||||
if (NS_ERROR_MALFORMED_URI == rv) {
|
||||
DisplayLoadError(rv, uri, aURI);
|
||||
} // end unknown protocol
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv) || !uri)
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -2444,6 +2443,11 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
|
||||
// XXX: Need to pass in the extra headers stream too...
|
||||
|
||||
rv = LoadURI(uri, loadInfo, 0, PR_TRUE);
|
||||
|
||||
if (NS_ERROR_UNKNOWN_PROTOCOL == rv) {
|
||||
DisplayLoadError(rv, uri, aURI);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -2467,13 +2471,11 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aUR
|
||||
|
||||
// Turn the error code into a human readable error message.
|
||||
if (NS_ERROR_UNKNOWN_PROTOCOL == aError) {
|
||||
NS_ENSURE_ARG_POINTER(aURL);
|
||||
const nsAutoString uriString(aURL);
|
||||
PRInt32 colon = uriString.FindChar(':');
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
// extract the scheme
|
||||
nsAutoString scheme;
|
||||
uriString.Left(scheme, colon);
|
||||
formatStrs[0].Assign(scheme.get());
|
||||
nsCAutoString scheme;
|
||||
aURI->GetScheme(scheme);
|
||||
CopyASCIItoUCS2(scheme, formatStrs[0]);
|
||||
formatStrCount = 1;
|
||||
error.Assign(NS_LITERAL_STRING("protocolNotFound"));
|
||||
}
|
||||
@ -5158,8 +5160,17 @@ nsDocShell::DoURILoad(nsIURI * aURI,
|
||||
loadGroup,
|
||||
NS_STATIC_CAST(nsIInterfaceRequestor *, this),
|
||||
loadFlags);
|
||||
if (NS_FAILED(rv))
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_UNKNOWN_PROTOCOL) {
|
||||
// This is a uri with a protocol scheme we don't know how
|
||||
// to handle. Embedders might still be interested in
|
||||
// handling the load, though, so we fire a notification
|
||||
// before throwing the load away.
|
||||
PRBool abort;
|
||||
mContentListener->OnStartURIOpen(aURI, &abort);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
channel->SetOriginalURI(aURI);
|
||||
|
||||
|
||||
@ -464,25 +464,25 @@ nsWebShell::SetRendering(PRBool aRender)
|
||||
|
||||
struct OnLinkClickEvent : public PLEvent {
|
||||
OnLinkClickEvent(nsWebShell* aHandler, nsIContent* aContent,
|
||||
nsLinkVerb aVerb, const PRUnichar* aURLSpec,
|
||||
nsLinkVerb aVerb, nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec, nsIInputStream* aPostDataStream = 0,
|
||||
nsIInputStream* aHeadersDataStream = 0);
|
||||
~OnLinkClickEvent();
|
||||
|
||||
void HandleEvent() {
|
||||
mHandler->OnLinkClickSync(mContent, mVerb, mURLSpec.get(),
|
||||
mHandler->OnLinkClickSync(mContent, mVerb, mURI,
|
||||
mTargetSpec.get(), mPostDataStream,
|
||||
mHeadersDataStream,
|
||||
nsnull, nsnull);
|
||||
}
|
||||
|
||||
nsWebShell* mHandler;
|
||||
nsString mURLSpec;
|
||||
nsString mTargetSpec;
|
||||
nsWebShell* mHandler;
|
||||
nsCOMPtr<nsIURI> mURI;
|
||||
nsString mTargetSpec;
|
||||
nsCOMPtr<nsIInputStream> mPostDataStream;
|
||||
nsCOMPtr<nsIInputStream> mHeadersDataStream;
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsLinkVerb mVerb;
|
||||
nsLinkVerb mVerb;
|
||||
};
|
||||
|
||||
static void PR_CALLBACK HandlePLEvent(OnLinkClickEvent* aEvent)
|
||||
@ -498,14 +498,14 @@ static void PR_CALLBACK DestroyPLEvent(OnLinkClickEvent* aEvent)
|
||||
OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler,
|
||||
nsIContent *aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream,
|
||||
nsIInputStream* aHeadersDataStream)
|
||||
{
|
||||
mHandler = aHandler;
|
||||
NS_ADDREF(aHandler);
|
||||
mURLSpec.Assign(aURLSpec);
|
||||
mURI = aURI;
|
||||
mTargetSpec.Assign(aTargetSpec);
|
||||
mPostDataStream = aPostDataStream;
|
||||
mHeadersDataStream = aHeadersDataStream;
|
||||
@ -533,7 +533,7 @@ OnLinkClickEvent::~OnLinkClickEvent()
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnLinkClick(nsIContent* aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream,
|
||||
nsIInputStream* aHeadersDataStream)
|
||||
@ -541,7 +541,7 @@ nsWebShell::OnLinkClick(nsIContent* aContent,
|
||||
OnLinkClickEvent* ev;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
ev = new OnLinkClickEvent(this, aContent, aVerb, aURLSpec,
|
||||
ev = new OnLinkClickEvent(this, aContent, aVerb, aURI,
|
||||
aTargetSpec, aPostDataStream, aHeadersDataStream);
|
||||
if (nsnull == ev) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
@ -564,7 +564,7 @@ nsWebShell::GetEventQueue(nsIEventQueue **aQueue)
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnLinkClickSync(nsIContent *aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
@ -590,52 +590,7 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
|
||||
// Fall through, this seems like the most reasonable action
|
||||
case eLinkVerb_Replace:
|
||||
{
|
||||
// get a charset of the document and use is as originCharset
|
||||
nsAutoString docCharset;
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
nsDocShell::GetPresShell(getter_AddRefs(presShell));
|
||||
if (presShell)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
presShell->GetDocument(getter_AddRefs(doc));
|
||||
if (doc &&
|
||||
NS_FAILED(doc->GetDocumentCharacterSet(docCharset)))
|
||||
docCharset.Truncate();
|
||||
}
|
||||
|
||||
// for now, just hack the verb to be view-link-clicked
|
||||
// and down in the load document code we'll detect this and
|
||||
// set the correct uri loader command
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NewURI(getter_AddRefs(uri), nsDependentString(aURLSpec),
|
||||
docCharset.IsEmpty()
|
||||
? nsnull
|
||||
: NS_LossyConvertUCS2toASCII(docCharset).get());
|
||||
|
||||
// No URI object? This may indicate the URLspec is for an
|
||||
// unrecognized protocol. Embedders might still be interested
|
||||
// in handling the click, so we fire a notification before
|
||||
// throwing the click away.
|
||||
if (!uri && NS_SUCCEEDED(EnsureContentListener()))
|
||||
{
|
||||
NS_ConvertUCS2toUTF8 spec(aURLSpec);
|
||||
PRBool abort = PR_FALSE;
|
||||
uri = do_CreateInstance(kSimpleURICID, &rv);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "can't create simple uri");
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = uri->SetSpec(spec);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "spec is invalid");
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
mContentListener->OnStartURIOpen(uri, &abort);
|
||||
}
|
||||
}
|
||||
// We didn't load the URI, so we failed
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return InternalLoad(uri, // New URI
|
||||
return InternalLoad(aURI, // New URI
|
||||
mCurrentURI, // Referer URI
|
||||
nsnull, // No onwer
|
||||
PR_TRUE, // Inherit owner from document
|
||||
@ -660,32 +615,27 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnOverLink(nsIContent* aContent,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec)
|
||||
{
|
||||
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
|
||||
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if(browserChrome) {
|
||||
if (browserChrome) {
|
||||
nsCOMPtr<nsITextToSubURI> textToSubURI = do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// use doc charset to unescape the URL
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
nsDocShell::GetPresShell(getter_AddRefs(presShell));
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||
// use url origin charset to unescape the URL
|
||||
nsCAutoString charset;
|
||||
rv = aURI->GetOriginCharset(charset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
presShell->GetDocument(getter_AddRefs(doc));
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
nsAutoString charset;
|
||||
rv = doc->GetDocumentCharacterSet(charset);
|
||||
nsCAutoString spec;
|
||||
rv = aURI->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoString uStr;
|
||||
rv = textToSubURI->UnEscapeURIForUI(NS_LossyConvertUCS2toASCII(charset),
|
||||
NS_ConvertUCS2toUTF8(aURLSpec), uStr);
|
||||
rv = textToSubURI->UnEscapeURIForUI(charset, spec, uStr);
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = browserChrome->SetStatus(nsIWebBrowserChrome::STATUS_LINK, uStr.get());
|
||||
@ -693,6 +643,19 @@ nsWebShell::OnOverLink(nsIContent* aContent,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnLeaveLink()
|
||||
{
|
||||
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (browserChrome) {
|
||||
rv = browserChrome->SetStatus(nsIWebBrowserChrome::STATUS_LINK,
|
||||
NS_LITERAL_STRING("").get());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsWebShell::NormalizeURI(nsACString& aURLSpec)
|
||||
{
|
||||
|
||||
@ -71,21 +71,22 @@ public:
|
||||
// nsILinkHandler
|
||||
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
nsIInputStream* aHeadersDataStream = 0);
|
||||
NS_IMETHOD OnLinkClickSync(nsIContent* aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
nsIInputStream* aHeadersDataStream = 0,
|
||||
nsIDocShell** aDocShell = 0,
|
||||
nsIRequest** aRequest = 0);
|
||||
NS_IMETHOD OnOverLink(nsIContent* aContent,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec);
|
||||
NS_IMETHOD OnLeaveLink();
|
||||
NS_IMETHOD GetLinkState(const nsACString& aLinkURI, nsLinkState& aState);
|
||||
|
||||
NS_IMETHOD Create();
|
||||
|
||||
@ -466,7 +466,11 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext)
|
||||
nsCOMPtr<nsIURI> actionURL;
|
||||
nsXPIDLCString scheme;
|
||||
PRBool isJSURL = PR_FALSE;
|
||||
if (NS_SUCCEEDED(result = NS_NewURI(getter_AddRefs(actionURL), href, nsnull, docURL))) {
|
||||
nsAutoString docCharset;
|
||||
document->GetDocumentCharacterSet(docCharset);
|
||||
if (NS_SUCCEEDED(result = NS_NewURI(getter_AddRefs(actionURL), href,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(),
|
||||
docURL))) {
|
||||
result = actionURL->SchemeIs("javascript", &isJSURL);
|
||||
}
|
||||
// Append the URI encoded variable/value pairs for GET's
|
||||
@ -480,14 +484,15 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext)
|
||||
}
|
||||
href.Append(data);
|
||||
}
|
||||
nsAutoString absURLSpec;
|
||||
result = NS_MakeAbsoluteURI(absURLSpec, href, docURL);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
result = NS_NewURI(getter_AddRefs(uri), href,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(), docURL);
|
||||
if (NS_FAILED(result)) return result;
|
||||
|
||||
// Now pass on absolute url to the click handler
|
||||
if (handler) {
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace,
|
||||
absURLSpec.get(),
|
||||
uri,
|
||||
nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsString.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
@ -46,6 +47,7 @@
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsImageMap.h"
|
||||
@ -1516,13 +1518,13 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext)
|
||||
|
||||
void
|
||||
nsImageFrame::TriggerLink(nsIPresContext* aPresContext,
|
||||
const nsString& aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const nsString& aTargetSpec,
|
||||
PRBool aClick)
|
||||
{
|
||||
// We get here with server side image map
|
||||
nsILinkHandler* handler = nsnull;
|
||||
aPresContext->GetLinkHandler(&handler);
|
||||
nsCOMPtr<nsILinkHandler> handler;
|
||||
aPresContext->GetLinkHandler(getter_AddRefs(handler));
|
||||
if (nsnull != handler) {
|
||||
if (aClick) {
|
||||
nsresult proceed = NS_OK;
|
||||
@ -1542,22 +1544,18 @@ nsImageFrame::TriggerLink(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIURI> baseURI;
|
||||
if (NS_SUCCEEDED(rv) && doc)
|
||||
doc->GetDocumentURL(getter_AddRefs(baseURI));
|
||||
nsCOMPtr<nsIURI> absURI;
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = NS_NewURI(getter_AddRefs(absURI), aURLSpec, nsnull, baseURI);
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
proceed = securityManager->CheckLoadURI(baseURI, absURI, nsIScriptSecurityManager::STANDARD);
|
||||
proceed = securityManager->CheckLoadURI(baseURI, aURI, nsIScriptSecurityManager::STANDARD);
|
||||
|
||||
// Only pass off the click event if the script security manager
|
||||
// says it's ok.
|
||||
if (NS_SUCCEEDED(proceed))
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace, aURLSpec.get(), aTargetSpec.get());
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace, aURI, aTargetSpec.get());
|
||||
}
|
||||
else {
|
||||
handler->OnOverLink(mContent, aURLSpec.get(), aTargetSpec.get());
|
||||
handler->OnOverLink(mContent, aURI, aTargetSpec.get());
|
||||
}
|
||||
NS_RELEASE(handler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1738,7 +1736,20 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
// element to provide the basis for the destination url.
|
||||
nsAutoString src;
|
||||
if (GetAnchorHREFAndTarget(src, target)) {
|
||||
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
mContent->GetNodeInfo(*getter_AddRefs(nodeInfo));
|
||||
NS_ASSERTION(nodeInfo, "Image content without a nodeinfo?");
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nodeInfo->GetDocument(*getter_AddRefs(doc));
|
||||
nsAutoString charset;
|
||||
if (doc) {
|
||||
doc->GetDocumentCharacterSet(charset);
|
||||
}
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), src,
|
||||
NS_LossyConvertUCS2toASCII(charset).get(),
|
||||
baseURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// XXX if the mouse is over/clicked in the border/padding area
|
||||
// we should probably just pretend nothing happened. Nav4
|
||||
@ -1747,15 +1758,22 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
// mouse is over the border.
|
||||
if (p.x < 0) p.x = 0;
|
||||
if (p.y < 0) p.y = 0;
|
||||
char cbuf[50];
|
||||
PR_snprintf(cbuf, sizeof(cbuf), "?%d,%d", p.x, p.y);
|
||||
absURL.AppendWithConversion(cbuf);
|
||||
nsCOMPtr<nsIURL> url = do_QueryInterface(uri);
|
||||
if (url) {
|
||||
url->SetQuery(nsPrintfCString("%d,%d", p.x, p.y));
|
||||
} else {
|
||||
nsCAutoString spec;
|
||||
uri->GetSpec(spec);
|
||||
spec += nsPrintfCString("?%d,%d", p.x, p.y);
|
||||
uri->SetSpec(spec);
|
||||
}
|
||||
|
||||
PRBool clicked = PR_FALSE;
|
||||
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) {
|
||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
clicked = PR_TRUE;
|
||||
}
|
||||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
TriggerLink(aPresContext, uri, target, clicked);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -178,7 +178,7 @@ protected:
|
||||
nsImageMap* GetImageMap(nsIPresContext* aPresContext);
|
||||
|
||||
void TriggerLink(nsIPresContext* aPresContext,
|
||||
const nsString& aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const nsString& aTargetSpec,
|
||||
PRBool aClick);
|
||||
|
||||
|
||||
@ -2327,9 +2327,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
|
||||
NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);
|
||||
|
||||
nsAutoString uniurl; uniurl.AssignWithConversion(aURL);
|
||||
nsAutoString unitarget; unitarget.AssignWithConversion(aTarget);
|
||||
nsAutoString fullurl;
|
||||
|
||||
nsCOMPtr<nsIURI> baseURL;
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
@ -2341,9 +2339,10 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
}
|
||||
|
||||
// Create an absolute URL
|
||||
NS_MakeAbsoluteURI(fullurl, uniurl, baseURL);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), aURL, baseURL);
|
||||
|
||||
NS_ENSURE_TRUE(NS_SUCCEEDED(rv),NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
mOwner->GetContent(getter_AddRefs(content));
|
||||
NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
|
||||
@ -2372,7 +2371,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
}
|
||||
|
||||
rv = lh->OnLinkClick(content, eLinkVerb_Replace,
|
||||
fullurl.get(), unitarget.get(),
|
||||
uri, unitarget.get(),
|
||||
postDataStream, headersDataStream);
|
||||
|
||||
return rv;
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsString.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
@ -46,6 +47,7 @@
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsImageMap.h"
|
||||
@ -1516,13 +1518,13 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext)
|
||||
|
||||
void
|
||||
nsImageFrame::TriggerLink(nsIPresContext* aPresContext,
|
||||
const nsString& aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const nsString& aTargetSpec,
|
||||
PRBool aClick)
|
||||
{
|
||||
// We get here with server side image map
|
||||
nsILinkHandler* handler = nsnull;
|
||||
aPresContext->GetLinkHandler(&handler);
|
||||
nsCOMPtr<nsILinkHandler> handler;
|
||||
aPresContext->GetLinkHandler(getter_AddRefs(handler));
|
||||
if (nsnull != handler) {
|
||||
if (aClick) {
|
||||
nsresult proceed = NS_OK;
|
||||
@ -1542,22 +1544,18 @@ nsImageFrame::TriggerLink(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIURI> baseURI;
|
||||
if (NS_SUCCEEDED(rv) && doc)
|
||||
doc->GetDocumentURL(getter_AddRefs(baseURI));
|
||||
nsCOMPtr<nsIURI> absURI;
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = NS_NewURI(getter_AddRefs(absURI), aURLSpec, nsnull, baseURI);
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
proceed = securityManager->CheckLoadURI(baseURI, absURI, nsIScriptSecurityManager::STANDARD);
|
||||
proceed = securityManager->CheckLoadURI(baseURI, aURI, nsIScriptSecurityManager::STANDARD);
|
||||
|
||||
// Only pass off the click event if the script security manager
|
||||
// says it's ok.
|
||||
if (NS_SUCCEEDED(proceed))
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace, aURLSpec.get(), aTargetSpec.get());
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace, aURI, aTargetSpec.get());
|
||||
}
|
||||
else {
|
||||
handler->OnOverLink(mContent, aURLSpec.get(), aTargetSpec.get());
|
||||
handler->OnOverLink(mContent, aURI, aTargetSpec.get());
|
||||
}
|
||||
NS_RELEASE(handler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1738,7 +1736,20 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
// element to provide the basis for the destination url.
|
||||
nsAutoString src;
|
||||
if (GetAnchorHREFAndTarget(src, target)) {
|
||||
NS_MakeAbsoluteURI(absURL, src, baseURL);
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
mContent->GetNodeInfo(*getter_AddRefs(nodeInfo));
|
||||
NS_ASSERTION(nodeInfo, "Image content without a nodeinfo?");
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nodeInfo->GetDocument(*getter_AddRefs(doc));
|
||||
nsAutoString charset;
|
||||
if (doc) {
|
||||
doc->GetDocumentCharacterSet(charset);
|
||||
}
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), src,
|
||||
NS_LossyConvertUCS2toASCII(charset).get(),
|
||||
baseURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// XXX if the mouse is over/clicked in the border/padding area
|
||||
// we should probably just pretend nothing happened. Nav4
|
||||
@ -1747,15 +1758,22 @@ nsImageFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
// mouse is over the border.
|
||||
if (p.x < 0) p.x = 0;
|
||||
if (p.y < 0) p.y = 0;
|
||||
char cbuf[50];
|
||||
PR_snprintf(cbuf, sizeof(cbuf), "?%d,%d", p.x, p.y);
|
||||
absURL.AppendWithConversion(cbuf);
|
||||
nsCOMPtr<nsIURL> url = do_QueryInterface(uri);
|
||||
if (url) {
|
||||
url->SetQuery(nsPrintfCString("%d,%d", p.x, p.y));
|
||||
} else {
|
||||
nsCAutoString spec;
|
||||
uri->GetSpec(spec);
|
||||
spec += nsPrintfCString("?%d,%d", p.x, p.y);
|
||||
uri->SetSpec(spec);
|
||||
}
|
||||
|
||||
PRBool clicked = PR_FALSE;
|
||||
if (aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) {
|
||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
clicked = PR_TRUE;
|
||||
}
|
||||
TriggerLink(aPresContext, absURL, target, clicked);
|
||||
TriggerLink(aPresContext, uri, target, clicked);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -178,7 +178,7 @@ protected:
|
||||
nsImageMap* GetImageMap(nsIPresContext* aPresContext);
|
||||
|
||||
void TriggerLink(nsIPresContext* aPresContext,
|
||||
const nsString& aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const nsString& aTargetSpec,
|
||||
PRBool aClick);
|
||||
|
||||
|
||||
@ -2327,9 +2327,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
|
||||
NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);
|
||||
|
||||
nsAutoString uniurl; uniurl.AssignWithConversion(aURL);
|
||||
nsAutoString unitarget; unitarget.AssignWithConversion(aTarget);
|
||||
nsAutoString fullurl;
|
||||
|
||||
nsCOMPtr<nsIURI> baseURL;
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
@ -2341,9 +2339,10 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
}
|
||||
|
||||
// Create an absolute URL
|
||||
NS_MakeAbsoluteURI(fullurl, uniurl, baseURL);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), aURL, baseURL);
|
||||
|
||||
NS_ENSURE_TRUE(NS_SUCCEEDED(rv),NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIContent> content;
|
||||
mOwner->GetContent(getter_AddRefs(content));
|
||||
NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
|
||||
@ -2372,7 +2371,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
|
||||
}
|
||||
|
||||
rv = lh->OnLinkClick(content, eLinkVerb_Replace,
|
||||
fullurl.get(), unitarget.get(),
|
||||
uri, unitarget.get(),
|
||||
postDataStream, headersDataStream);
|
||||
|
||||
return rv;
|
||||
|
||||
@ -466,7 +466,11 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext)
|
||||
nsCOMPtr<nsIURI> actionURL;
|
||||
nsXPIDLCString scheme;
|
||||
PRBool isJSURL = PR_FALSE;
|
||||
if (NS_SUCCEEDED(result = NS_NewURI(getter_AddRefs(actionURL), href, nsnull, docURL))) {
|
||||
nsAutoString docCharset;
|
||||
document->GetDocumentCharacterSet(docCharset);
|
||||
if (NS_SUCCEEDED(result = NS_NewURI(getter_AddRefs(actionURL), href,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(),
|
||||
docURL))) {
|
||||
result = actionURL->SchemeIs("javascript", &isJSURL);
|
||||
}
|
||||
// Append the URI encoded variable/value pairs for GET's
|
||||
@ -480,14 +484,15 @@ nsIsIndexFrame::OnSubmit(nsIPresContext* aPresContext)
|
||||
}
|
||||
href.Append(data);
|
||||
}
|
||||
nsAutoString absURLSpec;
|
||||
result = NS_MakeAbsoluteURI(absURLSpec, href, docURL);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
result = NS_NewURI(getter_AddRefs(uri), href,
|
||||
NS_LossyConvertUCS2toASCII(docCharset).get(), docURL);
|
||||
if (NS_FAILED(result)) return result;
|
||||
|
||||
// Now pass on absolute url to the click handler
|
||||
if (handler) {
|
||||
handler->OnLinkClick(mContent, eLinkVerb_Replace,
|
||||
absURLSpec.get(),
|
||||
uri,
|
||||
nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1870,6 +1870,9 @@ nsTreeBodyFrame::GetImage(PRInt32 aRowIndex, const PRUnichar* aColID, PRBool aUs
|
||||
rv = il->LoadImage(srcURI, nsnull, documentURI, nsnull, listener, mPresContext, nsIRequest::LOAD_NORMAL, nsnull, nsnull, getter_AddRefs(imageRequest));
|
||||
mImageGuard = PR_FALSE;
|
||||
|
||||
if (!imageRequest)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// In a case it was already cached.
|
||||
imageRequest->GetImage(aResult);
|
||||
|
||||
|
||||
@ -1147,15 +1147,13 @@ NS_IMETHODIMP pluginInstanceOwner::GetURL(const char *aURL, const char *aTarget,
|
||||
nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
|
||||
NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = mViewer->GetURI(getter_AddRefs(uri));
|
||||
NS_ENSURE_TRUE(NS_SUCCEEDED(rv),NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIURI> baseURI;
|
||||
rv = mViewer->GetURI(getter_AddRefs(baseURI));
|
||||
NS_ENSURE_SUCCESS(rv,NS_ERROR_FAILURE);
|
||||
|
||||
char* absURIStr;
|
||||
NS_MakeAbsoluteURI(&absURIStr, aURL, uri);
|
||||
nsAutoString fullurl; fullurl.AssignWithConversion(absURIStr);
|
||||
nsCRT::free(absURIStr);
|
||||
NS_ENSURE_TRUE(NS_SUCCEEDED(rv),NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIURI> targetURI;
|
||||
rv = NS_NewURI(getter_AddRefs(targetURI), aURL, baseURI);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIInputStream> postDataStream;
|
||||
nsCOMPtr<nsIInputStream> headersDataStream;
|
||||
@ -1180,7 +1178,7 @@ NS_IMETHODIMP pluginInstanceOwner::GetURL(const char *aURL, const char *aTarget,
|
||||
|
||||
nsAutoString unitarget; unitarget.AssignWithConversion(aTarget);
|
||||
rv = lh->OnLinkClick(nsnull, eLinkVerb_Replace,
|
||||
fullurl.get(), unitarget.get(),
|
||||
targetURI, unitarget.get(),
|
||||
postDataStream, headersDataStream);
|
||||
|
||||
return rv;
|
||||
|
||||
@ -47,12 +47,12 @@ class nsExtProtocolChannel : public nsIChannel
|
||||
{
|
||||
public:
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSICHANNEL
|
||||
NS_DECL_NSIREQUEST
|
||||
|
||||
nsExtProtocolChannel();
|
||||
virtual ~nsExtProtocolChannel();
|
||||
virtual ~nsExtProtocolChannel();
|
||||
|
||||
nsresult SetURI(nsIURI*);
|
||||
|
||||
@ -136,15 +136,17 @@ nsresult nsExtProtocolChannel::SetURI(nsIURI* aURI)
|
||||
nsresult nsExtProtocolChannel::OpenURL()
|
||||
{
|
||||
nsCOMPtr<nsIExternalProtocolService> extProtService (do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID));
|
||||
PRBool haveHandler = PR_FALSE;
|
||||
nsCAutoString urlScheme;
|
||||
mUrl->GetScheme(urlScheme);
|
||||
|
||||
if (extProtService)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
PRBool haveHandler = PR_FALSE;
|
||||
extProtService->ExternalProtocolHandlerExists(urlScheme.get(), &haveHandler);
|
||||
if (haveHandler)
|
||||
return extProtService->LoadUrl(mUrl);
|
||||
NS_ASSERTION(haveHandler, "Why do we have a channel for this url if we don't support the protocol?");
|
||||
#endif
|
||||
return extProtService->LoadUrl(mUrl);
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -327,22 +329,13 @@ NS_IMETHODIMP nsExternalProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
nsIURI *aBaseURI,
|
||||
nsIURI **_retval)
|
||||
{
|
||||
nsresult rv = NS_ERROR_UNKNOWN_PROTOCOL;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIURI> uri = do_CreateInstance(kSimpleURICID, &rv);
|
||||
if (uri)
|
||||
{
|
||||
uri->SetSpec(aSpec);
|
||||
PRBool haveHandler = HaveProtocolHandler(uri);
|
||||
|
||||
if (haveHandler)
|
||||
{
|
||||
*_retval = uri;
|
||||
NS_IF_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_UNKNOWN_PROTOCOL;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uri->SetSpec(aSpec);
|
||||
NS_ADDREF(*_retval = uri);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
|
||||
|
||||
@ -79,8 +79,7 @@ public:
|
||||
*
|
||||
* @param aContent the content for the frame that generated the trigger
|
||||
* @param aVerb the verb to use when the link is triggered
|
||||
* @param aURLSpec an absolute URL spec that defines the destination for the
|
||||
* link
|
||||
* @param aURI a URI object that defines the destination for the link
|
||||
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
||||
* string)
|
||||
* @param aPostDataStream the POST data to send
|
||||
@ -88,7 +87,7 @@ public:
|
||||
*/
|
||||
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
nsIInputStream* aHeadersDataStream = 0) = 0;
|
||||
@ -101,8 +100,7 @@ public:
|
||||
*
|
||||
* @param aContent the content for the frame that generated the trigger
|
||||
* @param aVerb the verb to use when the link is triggered
|
||||
* @param aURLSpec an absolute URL spec that defines the destination for the
|
||||
* link
|
||||
* @param aURI a URI obect that defines the destination for the link
|
||||
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
||||
* string)
|
||||
* @param aPostDataStream the POST data to send
|
||||
@ -112,7 +110,7 @@ public:
|
||||
*/
|
||||
NS_IMETHOD OnLinkClickSync(nsIContent* aContent,
|
||||
nsLinkVerb aVerb,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURI,
|
||||
const PRUnichar* aTargetSpec,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
nsIInputStream* aHeadersDataStream = 0,
|
||||
@ -123,15 +121,20 @@ public:
|
||||
* Process a mouse-over a link.
|
||||
*
|
||||
* @param aContent the linked content.
|
||||
* @param aURLSpec an absolute url spec that defines the destination for the
|
||||
* link
|
||||
* @param aURI an URI object that defines the destination for the link
|
||||
* @param aTargetSpec indicates where the link is targeted (it may be an empty
|
||||
* string)
|
||||
*/
|
||||
NS_IMETHOD OnOverLink(nsIContent* aContent,
|
||||
const PRUnichar* aURLSpec,
|
||||
nsIURI* aURLSpec,
|
||||
const PRUnichar* aTargetSpec) = 0;
|
||||
|
||||
/**
|
||||
* Process the mouse leaving a link.
|
||||
*/
|
||||
NS_IMETHOD OnLeaveLink() = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the state of a link to a given absolute URL
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user