Bug 975383 part.2 Remove compositionupdate dispatchers in nsWindow of Android r=nchen
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 03 Oct 2014 15:33:48 +0900
changeset 208526 f784b7a2d71804c03c32a15516b7df6ec2f555a4
parent 208525 3c8da0709f07151e0447389ad1ff641ec28fff7f
child 208527 84a46c657337e3539f229f13a3aa3ce8509bb670
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersnchen
bugs975383
milestone35.0a1
Bug 975383 part.2 Remove compositionupdate dispatchers in nsWindow of Android r=nchen
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1840,22 +1840,16 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *
                         true, NS_COMPOSITION_START, this);
                     InitEvent(event, nullptr);
                     DispatchEvent(&event);
                     mIMEComposingStart = ae->Start();
                 }
             }
 
             {
-                WidgetCompositionEvent event(true, NS_COMPOSITION_UPDATE, this);
-                InitEvent(event, nullptr);
-                event.data = ae->Characters();
-                DispatchEvent(&event);
-            }
-            {
                 WidgetTextEvent event(true, NS_TEXT_TEXT, this);
                 InitEvent(event, nullptr);
                 event.theText = ae->Characters();
 
                 if (ae->Action() == AndroidGeckoEvent::IME_COMPOSE_TEXT) {
                     // Because we're leaving the composition open, we need to
                     // include proper text ranges to make the editor happy.
                     TextRange range;
@@ -2005,25 +1999,16 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *
                 }
 
             } else {
                 // If the new composition matches the existing composition,
                 // reuse the old composition.
                 event.theText = mIMEComposingText;
             }
 
-            {
-                WidgetCompositionEvent compositionUpdate(true,
-                                                         NS_COMPOSITION_UPDATE,
-                                                         this);
-                InitEvent(compositionUpdate, nullptr);
-                compositionUpdate.data = event.theText;
-                DispatchEvent(&compositionUpdate);
-            }
-
 #ifdef DEBUG_ANDROID_IME
             const NS_ConvertUTF16toUTF8 theText8(event.theText);
             const char* text = theText8.get();
             ALOGIME("IME: IME_SET_TEXT: text=\"%s\", length=%u, range=%u",
                     text, event.theText.Length(), event.mRanges->Length());
 #endif // DEBUG_ANDROID_IME
 
             DispatchEvent(&event);
@@ -2096,21 +2081,16 @@ nsWindow::NotifyIME(const IMENotificatio
             return NS_OK;
         case REQUEST_TO_CANCEL_COMPOSITION:
             ALOGIME("IME: REQUEST_TO_CANCEL_COMPOSITION");
 
             // Cancel composition on Gecko side
             if (mIMEComposing) {
                 nsRefPtr<nsWindow> kungFuDeathGrip(this);
 
-                WidgetCompositionEvent updateEvent(true, NS_COMPOSITION_UPDATE,
-                                                   this);
-                InitEvent(updateEvent, nullptr);
-                DispatchEvent(&updateEvent);
-
                 WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
                 InitEvent(textEvent, nullptr);
                 DispatchEvent(&textEvent);
 
                 WidgetCompositionEvent compEvent(true, NS_COMPOSITION_END,
                                                  this);
                 InitEvent(compEvent, nullptr);
                 DispatchEvent(&compEvent);