diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp
index e4172bc81f36..36aad32c7cba 100644
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -1756,37 +1756,37 @@ nsGenericHTMLFormElement* HTMLFormElement::GetDefaultSubmitElement() const {
}
bool HTMLFormElement::IsDefaultSubmitElement(
- const nsIFormControl* aControl) const {
- MOZ_ASSERT(aControl, "Unexpected call");
+ const nsGenericHTMLFormElement* aElement) const {
+ MOZ_ASSERT(aElement, "Unexpected call");
- if (aControl == mDefaultSubmitElement) {
+ if (aElement == mDefaultSubmitElement) {
// Yes, it is
return true;
}
- if (mDefaultSubmitElement || (aControl != mFirstSubmitInElements &&
- aControl != mFirstSubmitNotInElements)) {
+ if (mDefaultSubmitElement || (aElement != mFirstSubmitInElements &&
+ aElement != mFirstSubmitNotInElements)) {
// It isn't
return false;
}
// mDefaultSubmitElement is null, but we have a non-null submit around
- // (aControl, in fact). figure out whether it's in fact the default submit
+ // (aElement, in fact). figure out whether it's in fact the default submit
// and just hasn't been set that way yet. Note that we can't just call
// HandleDefaultSubmitRemoval because we might need to notify to handle that
// correctly and we don't know whether that's safe right here.
if (!mFirstSubmitInElements || !mFirstSubmitNotInElements) {
- // We only have one first submit; aControl has to be it
+ // We only have one first submit; aElement has to be it
return true;
}
// We have both kinds of submits. Check which comes first.
- nsIFormControl* defaultSubmit =
+ nsGenericHTMLFormElement* defaultSubmit =
CompareFormControlPosition(mFirstSubmitInElements,
mFirstSubmitNotInElements, this) < 0
? mFirstSubmitInElements
: mFirstSubmitNotInElements;
- return aControl == defaultSubmit;
+ return aElement == defaultSubmit;
}
bool HTMLFormElement::ImplicitSubmissionIsDisabled() const {
diff --git a/dom/html/HTMLFormElement.h b/dom/html/HTMLFormElement.h
index 0b54b22e8dfa..031198ad7235 100644
--- a/dom/html/HTMLFormElement.h
+++ b/dom/html/HTMLFormElement.h
@@ -207,13 +207,13 @@ class HTMLFormElement final : public nsGenericHTMLElement,
bool IsLastActiveElement(const nsIFormControl* aControl) const;
/**
- * Check whether a given nsIFormControl is the default submit
+ * Check whether a given nsGenericHTMLFormElement is the default submit
* element. This is different from just comparing to
* GetDefaultSubmitElement() in certain situations inside an update
- * when GetDefaultSubmitElement() might not be up to date. aControl
+ * when GetDefaultSubmitElement() might not be up to date. aElement
* is expected to not be null.
*/
- bool IsDefaultSubmitElement(const nsIFormControl* aControl) const;
+ bool IsDefaultSubmitElement(const nsGenericHTMLFormElement* aElement) const;
/**
* Flag the form to know that a button or image triggered scripted form