Bug 975383 part.2 Remove compositionupdate dispatchers in nsWindow of Android r=nchen
--- 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);