Bug 1403795 - Remove nsIDOMHTMLButtonElement; r=bz

Removes the XPCOM interface for nsIDOMHTMLButtonElement, replacing it
with binding class usage.

MozReview-Commit-ID: CzqRb7lI28W
This commit is contained in:
Kyle Machulis
2017-09-27 21:03:58 -07:00
parent d61d67d59f
commit 4dae9895ed
9 changed files with 48 additions and 100 deletions

View File

@@ -78,7 +78,6 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLButtonElement,
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLButtonElement,
nsGenericHTMLFormElementWithState,
nsIDOMHTMLButtonElement,
nsIConstraintValidation)
void
@@ -110,32 +109,25 @@ HTMLButtonElement::FieldSetDisabledChanged(bool aNotify)
UpdateState(aNotify);
}
// nsIDOMHTMLButtonElement
NS_IMPL_ELEMENT_CLONE(HTMLButtonElement)
// nsIDOMHTMLButtonElement
NS_IMETHODIMP
HTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
void
HTMLButtonElement::GetFormEnctype(nsAString& aFormEncType)
{
return nsGenericHTMLFormElementWithState::GetForm(aForm);
GetEnumAttr(nsGkAtoms::formenctype, "", kFormDefaultEnctype->tag, aFormEncType);
}
NS_IMPL_BOOL_ATTR(HTMLButtonElement, Autofocus, autofocus)
NS_IMPL_BOOL_ATTR(HTMLButtonElement, Disabled, disabled)
NS_IMPL_ACTION_ATTR(HTMLButtonElement, FormAction, formaction)
NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(HTMLButtonElement, FormEnctype, formenctype,
"", kFormDefaultEnctype->tag)
NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES(HTMLButtonElement, FormMethod, formmethod,
"", kFormDefaultMethod->tag)
NS_IMPL_BOOL_ATTR(HTMLButtonElement, FormNoValidate, formnovalidate)
NS_IMPL_STRING_ATTR(HTMLButtonElement, FormTarget, formtarget)
NS_IMPL_STRING_ATTR(HTMLButtonElement, Name, name)
NS_IMPL_STRING_ATTR(HTMLButtonElement, Value, value)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLButtonElement, Type, type,
kButtonDefaultType->tag)
void
HTMLButtonElement::GetFormMethod(nsAString& aFormMethod)
{
GetEnumAttr(nsGkAtoms::formmethod, "", kFormDefaultMethod->tag, aFormMethod);
}
void
HTMLButtonElement::GetType(nsAString& aType)
{
GetEnumAttr(nsGkAtoms::type, kButtonDefaultType->tag, aType);
}
int32_t
HTMLButtonElement::TabIndexDefault()
@@ -375,7 +367,7 @@ HTMLButtonElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
// Get the name (if no name, no submit)
//
nsAutoString name;
GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
GetHTMLAttr(nsGkAtoms::name, name);
if (name.IsEmpty()) {
return NS_OK;
}
@@ -384,10 +376,7 @@ HTMLButtonElement::SubmitNamesValues(HTMLFormSubmission* aFormSubmission)
// Get the value
//
nsAutoString value;
nsresult rv = GetValue(value);
if (NS_FAILED(rv)) {
return rv;
}
GetHTMLAttr(nsGkAtoms::value, value);
//
// Submit
@@ -471,7 +460,8 @@ bool
HTMLButtonElement::RestoreState(nsPresState* aState)
{
if (aState && aState->IsDisabledSet() && !aState->GetDisabled()) {
SetDisabled(false);
IgnoredErrorResult rv;
SetDisabled(false, rv);
}
return false;