Bug 1077345 part.8 CompositionManager.endComposition() in forms.js should use nsIDOMWindowUtils.sendCompositionEvent('compositioncommit') r=xyuan

This commit is contained in:
Masayuki Nakano 2014-11-25 14:02:32 +09:00
parent 9f491a5703
commit fa0d074313

View File

@ -1277,14 +1277,7 @@ let CompositionManager = {
if (!this._isStarted) {
return;
}
// Update the composing text.
let compositionString = domWindowUtils.createCompositionStringSynthesizer();
compositionString.setString(text);
// Set the cursor position to |text.length| so that the text will be
// committed before the cursor position.
compositionString.setCaret(text.length, 0);
compositionString.dispatchEvent();
domWindowUtils.sendCompositionEvent('compositionend', text, '');
domWindowUtils.sendCompositionEvent('compositioncommit', text, '');
this._isStarted = false;
},