Bug 1728081 - Part 4: Make HTMLFormElement::GetDefaultSubmitElement return nsGenericHTMLFormElement; r=smaug
so that the callers don't need to queryInterface it back to nsIContent. Differential Revision: https://phabricator.services.mozilla.com/D123952
This commit is contained in:
@@ -2919,12 +2919,8 @@ nsresult HTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext) {
|
||||
}
|
||||
|
||||
// Get the default submit element
|
||||
nsIFormControl* submitControl = mForm->GetDefaultSubmitElement();
|
||||
if (submitControl) {
|
||||
nsCOMPtr<nsIContent> submitContent = do_QueryInterface(submitControl);
|
||||
NS_ASSERTION(submitContent, "Form control not implementing nsIContent?!");
|
||||
// Fire the button's onclick handler and let the button handle
|
||||
// submitting the form.
|
||||
if (RefPtr<nsGenericHTMLFormElement> submitContent =
|
||||
mForm->GetDefaultSubmitElement()) {
|
||||
WidgetMouseEvent event(true, eMouseClick, nullptr, WidgetMouseEvent::eReal);
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
presShell->HandleDOMEventWithTarget(submitContent, &event, &status);
|
||||
|
||||
Reference in New Issue
Block a user