Bug 1351860 - Move mType from HTMLInputElement to nsIFormControl and make GetType non-virtual inlined, r=jessica

This commit is contained in:
Olli Pettay
2017-03-31 13:13:36 -04:00
parent 6983716f3f
commit fa83f6684e
37 changed files with 69 additions and 76 deletions

View File

@@ -1054,8 +1054,7 @@ static nsresult FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
FromParser aFromParser, FromClone aFromClone)
: nsGenericHTMLFormElementWithState(aNodeInfo)
, mType(kInputDefaultType->value)
: nsGenericHTMLFormElementWithState(aNodeInfo, kInputDefaultType->value)
, mAutocompleteAttrState(nsContentUtils::eAutocompleteAttrState_Unknown)
, mDisabledChanged(false)
, mValueChanged(false)
@@ -3514,7 +3513,7 @@ HTMLInputElement::Focus(ErrorResult& aError)
// See if the child is a button control.
nsCOMPtr<nsIFormControl> formCtrl =
do_QueryInterface(childFrame->GetContent());
if (formCtrl && formCtrl->GetType() == NS_FORM_BUTTON_BUTTON) {
if (formCtrl && formCtrl->ControlType() == NS_FORM_BUTTON_BUTTON) {
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(formCtrl);
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm && element) {