mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00: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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user