mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Revert "Issue #2721 - Remove nsILinkHandler."
This reverts commit c3f1c0cdba.
This commit is contained in:
parent
f3ce3c21ee
commit
733789f40b
16 changed files with 160 additions and 88 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "nsIContentIterator.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsContainerFrame.h"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "mozilla/EventStates.h" // for member
|
||||
#include "mozilla/dom/DirectionalityUtils.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsINodeList.h"
|
||||
#include "nsNodeUtils.h"
|
||||
#include "nsAttrAndChildArray.h"
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIEditorIMESupport.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "mozilla/dom/NodeInfo.h"
|
||||
#include "mozilla/dom/NodeInfoInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsDocShell.h" // for ::Cast
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
|
|
@ -812,8 +811,9 @@ HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
|||
|
||||
// If there is no link handler, then we won't actually be able to submit.
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
nsCOMPtr<nsIDocShell> container = doc ? doc->GetDocShell() : nullptr;
|
||||
if (!container || IsEditable()) {
|
||||
nsCOMPtr<nsISupports> container = doc ? doc->GetContainer() : nullptr;
|
||||
nsCOMPtr<nsILinkHandler> linkHandler(do_QueryInterface(container));
|
||||
if (!linkHandler || IsEditable()) {
|
||||
mIsSubmitting = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
@ -892,12 +892,12 @@ HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
|||
getter_AddRefs(postDataStream));
|
||||
NS_ENSURE_SUBMIT_SUCCESS(rv);
|
||||
|
||||
rv = nsDocShell::Cast(container)->OnLinkClickSync(this, actionURI,
|
||||
target.get(),
|
||||
NullString(),
|
||||
postDataStream, nullptr,
|
||||
getter_AddRefs(docShell),
|
||||
getter_AddRefs(mSubmittingRequest));
|
||||
rv = linkHandler->OnLinkClickSync(this, actionURI,
|
||||
target.get(),
|
||||
NullString(),
|
||||
postDataStream, nullptr,
|
||||
getter_AddRefs(docShell),
|
||||
getter_AddRefs(mSubmittingRequest));
|
||||
NS_ENSURE_SUBMIT_SUCCESS(rv);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ else:
|
|||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/docshell/base',
|
||||
'/dom/base',
|
||||
'/dom/plugins/ipc',
|
||||
'/layout/generic',
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ using mozilla::DefaultXDisplay;
|
|||
#include "nsIStringStream.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
|
@ -45,7 +46,6 @@ using mozilla::DefaultXDisplay;
|
|||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsDocShell.h" // for ::Cast
|
||||
#include "ImageContainer.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "GLContext.h"
|
||||
|
|
@ -440,8 +440,10 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
|
|||
}
|
||||
|
||||
// the container of the pres context will give us the link handler
|
||||
nsCOMPtr<nsIDocShell> container = presContext->GetDocShell();
|
||||
nsCOMPtr<nsISupports> container = presContext->GetContainerWeak();
|
||||
NS_ENSURE_TRUE(container,NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(container);
|
||||
NS_ENSURE_TRUE(lh, NS_ERROR_FAILURE);
|
||||
|
||||
nsAutoString unitarget;
|
||||
if ((0 == PL_strcmp(aTarget, "newwindow")) ||
|
||||
|
|
@ -493,14 +495,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
|
|||
triggeringPrincipal = BasePrincipal::CreateCodebasePrincipal(uri, attrs);
|
||||
}
|
||||
|
||||
rv = nsDocShell::Cast(container)->OnLinkClick(content,
|
||||
uri,
|
||||
unitarget.get(),
|
||||
NullString(),
|
||||
aPostStream,
|
||||
headersDataStream,
|
||||
true,
|
||||
triggeringPrincipal);
|
||||
rv = lh->OnLinkClick(content, uri, unitarget.get(), NullString(),
|
||||
aPostStream, headersDataStream, true, triggeringPrincipal);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue