Bug 1424284 - Part 3. mHTMLInputType should set valid value. r=masayuki

Actually, current code gets type attribute by `GetAttr`, But this cannot get
valid value. If no type attribute, `mHTMLInputType` will be empty. So if type
has invalid value, we should return `text` value instead.

Depends on D69349

Differential Revision: https://phabricator.services.mozilla.com/D69350

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Makoto Kato 2020-04-07 08:37:44 +00:00
parent 9151f36c46
commit 9db27b76b5

View File

@ -1272,8 +1272,7 @@ void IMEStateManager::SetIMEState(const IMEState& aState,
if (aContent) {
if (aContent->IsHTMLElement(nsGkAtoms::input)) {
aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::type,
context.mHTMLInputType);
HTMLInputElement::FromNode(aContent)->GetType(context.mHTMLInputType);
GetActionHint(*aContent, context.mActionHint);
} else if (aContent->IsHTMLElement(nsGkAtoms::textarea)) {
context.mHTMLInputType.Assign(nsGkAtoms::textarea->GetUTF16String());