Bug 527935 - Part 3: Generate the input event for editor IME transaction commits if needed; r=roc a=blocking-final+
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 17 Dec 2010 14:47:11 -0800
changeset 59462 d52d8f50d2cfebf0b77cc976fab1d7525eaff2b1
parent 59461 839bb8d210a9b62a1728386cdcd579fa429eb8e8
child 59463 4f03895d544b32b1919de8a0ab4a06402ec6bda7
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersroc, blocking-final
bugs527935
milestone2.0b9pre
Bug 527935 - Part 3: Generate the input event for editor IME transaction commits if needed; r=roc a=blocking-final+
editor/libeditor/base/nsEditorEventListener.cpp
--- a/editor/libeditor/base/nsEditorEventListener.cpp
+++ b/editor/libeditor/base/nsEditorEventListener.cpp
@@ -808,16 +808,21 @@ nsEditorEventListener::HandleStartCompos
 
 NS_IMETHODIMP
 nsEditorEventListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
 {
   NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
   if (!mEditor->IsAcceptableInputEvent(aCompositionEvent)) {
     return NS_OK;
   }
+
+  // Transfer the event's trusted-ness to our editor
+  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aCompositionEvent);
+  nsAutoEditorKeypressOperation operation(mEditor, NSEvent);
+
   return mEditor->EndIMEComposition();
 }
 
 /**
  * nsIDOMFocusListener implementation
  */
 
 NS_IMETHODIMP