Bug 990473 - Check parent input for action hint if focus is in anonymous subtree; r=masayuki r=smaug

This commit is contained in:
Jim Chen 2014-07-18 12:53:41 -04:00
parent 1af57c9f58
commit 10b7761dfc

View File

@ -767,10 +767,16 @@ IMEStateManager::SetIMEState(const IMEState& aState,
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::moz_action_hint,
context.mActionHint);
// if we don't have an action hint and return won't submit the form use "next"
if (context.mActionHint.IsEmpty() && aContent->Tag() == nsGkAtoms::input) {
// Get the input content corresponding to the focused node,
// which may be an anonymous child of the input content.
nsIContent* inputContent = aContent->FindFirstNonChromeOnlyAccessContent();
// If we don't have an action hint and
// return won't submit the form, use "next".
if (context.mActionHint.IsEmpty() &&
inputContent->Tag() == nsGkAtoms::input) {
bool willSubmit = false;
nsCOMPtr<nsIFormControl> control(do_QueryInterface(aContent));
nsCOMPtr<nsIFormControl> control(do_QueryInterface(inputContent));
mozilla::dom::Element* formElement = control->GetFormElement();
nsCOMPtr<nsIForm> form;
if (control) {