mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #2721 - Remove nsILinkHandler.
This interface inly has a single implementation behind it, which is also only used in 2 places after the previous commit. That's a lot of additional complexity and compiler indirection for no good reason. This change removes the interface and uses direct nsDocShell::Cast calls instead of going through the interface in the few places left now that we no longer build on a presentation context for links.
This commit is contained in:
parent
37de431ac0
commit
c3f1c0cdba
16 changed files with 88 additions and 160 deletions
|
|
@ -27,7 +27,6 @@
|
|||
#include "nsIContentIterator.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsContainerFrame.h"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#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,7 +31,6 @@
|
|||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@
|
|||
#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,6 +49,7 @@
|
|||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsDocShell.h" // for ::Cast
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
|
|
@ -776,9 +777,8 @@ HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
|||
|
||||
// If there is no link handler, then we won't actually be able to submit.
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
nsCOMPtr<nsISupports> container = doc ? doc->GetContainer() : nullptr;
|
||||
nsCOMPtr<nsILinkHandler> linkHandler(do_QueryInterface(container));
|
||||
if (!linkHandler || IsEditable()) {
|
||||
nsCOMPtr<nsIDocShell> container = doc ? doc->GetDocShell() : nullptr;
|
||||
if (!container || IsEditable()) {
|
||||
mIsSubmitting = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
@ -857,12 +857,12 @@ HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
|||
getter_AddRefs(postDataStream));
|
||||
NS_ENSURE_SUBMIT_SUCCESS(rv);
|
||||
|
||||
rv = linkHandler->OnLinkClickSync(this, actionURI,
|
||||
target.get(),
|
||||
NullString(),
|
||||
postDataStream, nullptr,
|
||||
getter_AddRefs(docShell),
|
||||
getter_AddRefs(mSubmittingRequest));
|
||||
rv = nsDocShell::Cast(container)->OnLinkClickSync(this, actionURI,
|
||||
target.get(),
|
||||
NullString(),
|
||||
postDataStream, nullptr,
|
||||
getter_AddRefs(docShell),
|
||||
getter_AddRefs(mSubmittingRequest));
|
||||
NS_ENSURE_SUBMIT_SUCCESS(rv);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ else:
|
|||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/docshell/base',
|
||||
'/dom/base',
|
||||
'/dom/plugins/ipc',
|
||||
'/layout/generic',
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ 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"
|
||||
|
|
@ -46,6 +45,7 @@ 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,10 +440,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
|
|||
}
|
||||
|
||||
// the container of the pres context will give us the link handler
|
||||
nsCOMPtr<nsISupports> container = presContext->GetContainerWeak();
|
||||
nsCOMPtr<nsIDocShell> container = presContext->GetDocShell();
|
||||
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")) ||
|
||||
|
|
@ -495,8 +493,14 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
|
|||
triggeringPrincipal = BasePrincipal::CreateCodebasePrincipal(uri, attrs);
|
||||
}
|
||||
|
||||
rv = lh->OnLinkClick(content, uri, unitarget.get(), NullString(),
|
||||
aPostStream, headersDataStream, true, triggeringPrincipal);
|
||||
rv = nsDocShell::Cast(container)->OnLinkClick(content,
|
||||
uri,
|
||||
unitarget.get(),
|
||||
NullString(),
|
||||
aPostStream,
|
||||
headersDataStream,
|
||||
true,
|
||||
triggeringPrincipal);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue