Bug 1151186 part.2 nsHTMLEditor should accept composition events even while there is no active editing host but it has composition r=ehsan

This commit is contained in:
Masayuki Nakano 2015-04-08 11:50:13 +09:00
parent 3a535fd2d0
commit ed38b0607f
2 changed files with 9 additions and 0 deletions

View File

@ -146,6 +146,8 @@ GetEventMessageName(uint32_t aMessage)
return "NS_COMPOSITION_CHANGE";
case NS_COMPOSITION_COMMIT_AS_IS:
return "NS_COMPOSITION_COMMIT_AS_IS";
case NS_COMPOSITION_COMMIT:
return "NS_COMPOSITION_COMMIT";
default:
return "unacceptable event message";
}

View File

@ -5211,6 +5211,13 @@ nsHTMLEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
return false;
}
// While there is composition, all composition events in its top level window
// are always fired on the composing editor. Therefore, if this editor has
// composition, the composition events should be handled in this editor.
if (mComposition && aEvent->GetInternalNSEvent()->AsCompositionEvent()) {
return true;
}
NS_ENSURE_TRUE(mDocWeak, false);
nsCOMPtr<nsIDOMEventTarget> target;